akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<math.h>
int main(){
	int n,y,b[51],r[51],t[51],i,j,max;
	double c[51],a[51],max_num;
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			break;
		}
		scanf("%d",&y);
		for(i=0;i<n;i++){
			scanf("%d %d %d",&b[i],&r[i],&t[i]);
			c[i]=r[i]/100.0;
		}
		
		for(i=0;i<n;i++){
			if(t[i]==1){
				a[i]=1+(y*c[i]);
			}
			else if(t[i]==2){
				a[i]=pow(1+c[i],y);
			}
		}
		
		max_num = 0;
		for(i=0;i<n;i++){
			if(a[i]>max_num){
				max_num=a[i];
				max=b[i];
			}
		}
		
		printf("%d\n",max);
	}
	
	
return 0;
}

Measured memory_bytes: 692
#include<bits/stdc++.h>
using namespace std;
char a[200005];
int b,c;
int main(){
    cin>>a;int i;
    for(i=0;i<strlen(a);i++)
    if(a[i]=='A') break;
    b=i;
    for(i;i<strlen(a);i++)
    if(a[i]=='Z') c=i;
    cout<<c-b+1<<endl;
}

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

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni();
        int[] x = new int[n];
        for (int i = 0; i < n-1; i++) {
            x[in.ni()-1]++;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            sb.append(x[i]);
            sb.append("\n");
        }
        out.print(sb);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 54104
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
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++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

int tmp[200001], tmp2[200001];
void pakuripair_sort(int N, int A[], int B[]) {
	const int b = 8;
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) {
			tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
			tmp2[kazu[A[i] >> k * b & ((1 << b) - 1)]] = B[i];
		}
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) {
			A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
			B[kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp2[i];
		}
	}
}

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


	int N = getint(), K = getint();
	int A[200001];
	rep(i, N) {
		A[i] = (getint() + K - 1) % K;
	}

	int B[200001];
	B[0] = 0;
	rep(i, N) {
		B[i + 1] = B[i] + A[i];
		if (B[i + 1] >= K) B[i + 1] -= K;
	}
	rep(i, N + 1) A[i] = i;

	pakuripair_sort(N + 1, B, A);
	int kazu = 0;
	int mae = B[0];
	rep(i, N + 1) tmp[i] = 0;
	rep(i, N + 1) {
		if (mae != B[i]) {
			kazu++;
			mae = B[i];
		}
		tmp[A[i]] = kazu;
	}
	rep(i, N + 1) A[i] = 0;

	ll kotae = 0;
	rep(i, N + 1) {
		kotae += A[tmp[i]];
		A[tmp[i]]++;
		if (i - K + 1 >= 0) A[tmp[i - K + 1]]--;
	}

	printf("%lld", kotae);

	Would you please return 0;
}

Measured memory_bytes: 3456
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author emli
 */


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
class ANumberOfMultiples {
public:
    void solve(std::istream& cin, std::ostream& cout) {
		ios::sync_with_stdio(false);
        cin.tie(nullptr);
        int l,r,d;
        cin >> l >> r >> d;

        int ans = 0;
        for (int i = l; i <= r; ++i) {
            if (i % d == 0){
                ans++;
            }

        }
        cout << ans << endl;
	}
};


int main() {
	ANumberOfMultiples solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3648
for i in 1..3000
  a,b=gets.split.map(&:to_i);
  
  if a==0 and b==0 then
    break
  else 
    if a>b then
      puts b.to_s+ ' '+a.to_s
    else
      puts a.to_s+ ' '+b.to_s
    end
  end
end


Measured memory_bytes: 6856
#include <stdio.h>

int main(){
	int i=0;
	char s[4];
	scanf("%s",s);
	while(s[i]!=0)i++;
	if(i==2)printf("%s",s);
	else printf("%c%c%c",s[2],s[1],s[0]);
	return 0;
}
	


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



int main() {
	int N, M, buy;
	long long ans;
	cin >> N >> M;
	ans = 0;

	vector<int> A(N), B(N);
	for (int i = 0; i < N; i++) {
		cin >> A.at(i) >> B.at(i);
	}

	vector<pair<int, int>> AB(N);
	for (int i = 0; i < N; i++) {
		AB.at(i) = make_pair(A.at(i), B.at(i));
	}
	sort(AB.begin(), AB.end());

	for (int i = 0; i < N; i++) {
		buy = min(M, AB.at(i).second);
		ans +=(long long) buy * AB.at(i).first;
		M -= buy;
	}

	
	cout << ans << endl;
}

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

int main()
{
  int n;
  cin >> n;
  string s = to_string(n);


  vector< vector<int> > v(10, vector<int>(10,0)  );



  for (int i = 1; i <= n; i++)
  {
    string num = to_string(i);

    v.at( num.front()-'0' ).at(num.back()-'0')++;
  }

  long long ans=0;
  for (int i=1; i<=9; i++) {
    for (int j=1; j<=9 ; j++) {
      ans += v.at(i).at(j) * v.at(j).at(i);
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;


int main()
{
    string s;
    cin>>s;
    if(s.size()<6)
        cout<<"No"<<endl;
    else if(s[2]==s[3] && s[4]==s[5])
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 233;
int exgcd(int a,int b,int& x,int &y){
	if(b==0){
		x = 1;y = 0;
		return a;
	}
	int d = exgcd(b,a%b,y,x);
	y -= (a/b)*x;
	return d;
}
inline ll inv(int i){
	int x,y;
	exgcd(i,mod,x,y);
	return (x+mod)%mod;
}
int a[maxn];
ll fac[maxn];
int main()
{
	int n;cin>>n;
	ll add = 0,sub = 0;
	fac[0] = 1;
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		fac[i] = fac[i-1]*i%mod;
		if(i<n)add = (a[i]+add)%mod;
		if(i<n)sub = (a[i]+sub)%mod;
	}
//	cout<<"!"<<add<<" " <<sub<<endl; 
	add = (add+mod-a[n-1])%mod;
	sub = (sub+mod-a[1])%mod; 
	ll ans = 0;
	for(int l=2;l<=n-1;l++){
//		cout<<l<<": "<<add<<" "<<sub<<endl;
		ans = (ans+fac[n-1]*inv(l)%mod*inv(l-1)%mod*(sub+mod-add))%mod; 
		add = (add+mod-a[n-l])%mod;
		sub = (sub+mod-a[l])%mod;
		
	}
//	cout << add << " "<< sub << endl;
	for(int i=1;i<=n;i++){
		int l = n-i+1;
		ans = (ans+fac[n-1]*inv(l-1)%mod*(a[n]-a[i])%mod)%mod;
	}
//	for(int i=1;i<=n;i++)
//		for(int j=i+1;j<=n;j++){
//			int l = j-i+1;
//			if(j==n)ans = (ans+fac[n-1]*inv(l-1)%mod*(a[j]-a[i])%mod)%mod;
//			else ans = (ans+fac[n-1]*inv(l)%mod*inv(l-1)%mod*(a[j]-a[i]))%mod;
//		}
	cout << ans << endl;
}


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

int main() {
    string S;
    cin >> S;

    if(S[2]==S[3]&&S[4]==S[5])
        cout << "Yes";
    else
        cout << "No";
    cout << endl;

    return 0;
}

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

using namespace std;

int a, b, c, mx, ans = 1e9;

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

      mx = max(a, max(b, c));

      for(int i = mx; i <= 100; i ++){
            int res = 0;
            int x = a, y = b, z = c;
            while(x + 2 <= i){
                  x += 2;
                  res ++;
            }
            while(y + 2 <= i){
                  y += 2;
                  res ++;
            }
            while(z + 2 <= i){
                  z += 2;
                  res ++;
            }
            int cnt = 0;
            if(x != i) cnt ++;
            if(y != i) cnt ++;
            if(z != i) cnt ++;
            if(cnt % 2) continue;
            res += cnt / 2;

            ans = min(ans, res);
      }

      cout << ans << endl;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

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

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class ATableTennisTraining {
public:
    void solve(std::istream &in, std::ostream &out) {
        ll n, a, b;
        in >> n >> a >> b;
        ll res = a % 2 == b % 2 ? (b - a) / 2 : min((a + b - 1) / 2, (2 * n - a - b + 1) / 2);
        out << res << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    ATableTennisTraining solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


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


#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T, class T2> void amax(T& a,T2 b){ if(a < b) a = b;}

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VL a(n), sm(n+1);
	rep(i, n) cin >>a[i];
	rep(i, n) sm[i+1] = sm[i] + a[i];
	ll df = 1LL<<60;
	rep2(i,1, n){
		df = min(df, abs(2*sm[i] - sm[n]));
	}
	cout << df <<"\n";
	return 0;
}


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

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

const ll MOD = 1000000007LL; // = 10^9 + 7
const double PI = 3.14159265358979;

void solve()
{
  int n, m, ina, inb;
  cin >> n >> m;
  vector<vector<int>> a(n + 1, vector<int>());
  for(int i = 0; i < m; ++i)
  {
    cin >> ina >> inb;
    a[ina].emplace_back(inb);
  }

  const int INF = 1 << 30;

  int border = INF;
  int ans = 0;
  for(int i = 0; i < n; ++i)
  {
    if (border <= i)
    {
      ans++;
      border = INF;
    }
    if (a[i].size() == 0) continue;
    border = min(border, *min_element(a[i].begin(), a[i].end()) );
  }
  ans += (border != INF);
  cout << ans;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 8724
INF=10**5
while True:
  n=int(input())
  if n==0:break
  imos=[0 for i_ in range(INF)]
  for _ in range(n):
    a,b=input().split()
    s1=list(map(int,a.split(':')))
    s2=list(map(int,b.split(':')))
    s1=s1[0]*3600+s1[1]*60+s1[2]
    s2=s2[0]*3600+s2[1]*60+s2[2]
    imos[s1]+=1
    imos[s2]-=1
  for i in range(INF-1):
    imos[i+1]+=imos[i]
  print(max(imos))


Measured memory_bytes: 9816
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    S=input()
    
    st=0
    a=""
    b=""
    for i in range(N):
        s=S[i]
        if st==0 and s==")":
            a+="("
        elif s=="(":
            st+=1
        else:
            st-=1
    b+=")"*st
    print(a+S+b)

main()


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

int main() {
	int n, a, ans = 0;
	cin >> n;
	for (int i = 0; i <n; i++) {
		cin >> a;
		if (a % 2 == 1)ans++;
	}
	if (ans % 2)cout << "NO" << endl;
	else cout << "YES" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  map<char,int> mp;
  for(int i=0; i<S.size(); i++){
    if(mp.count(S.at(i))){
      mp[S.at(i)]++;
    }
    else{
      mp[S.at(i)] = 1;
    }
  }
  int64_t ans = S.size() * (S.size()-1) / 2;
  ans++;
  for(auto itr = mp.begin(); itr != mp.end(); itr++){
    int64_t x = itr->second;
    ans -= x * (x-1) / 2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

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

    ll N;
    string s;
    cin >> N >> s;

    ll cnt = 0;
    for (char c : s) {
        if (c == 'R') cnt++;
        else cnt--;
    }

    if (cnt > 0) cout << "Yes\n";
    else cout << "No\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define ll  long long
#define int long long
#define endl '\n'
#define pi 3.14159265
#define double long double
ll p(ll a,ll b)
{
    ll res=1;
    while(b)
    {
        if(b%2!=0)
            res*=a;
        a*=a;
        b/=2;
    }
    return res;
}
int32_t main()
{           
    IOS;
    ll n;
    string s;
    cin>>s;
    n=s.length();
    stack<ll> st;
    for(ll i=0;i<n;i++)
    {
        if(st.empty())
        {
            st.push(s[i]-'0');
            continue;
        }
        //trace1(i);
        ll val=st.top();
        if(val!=s[i]-'0')
            st.pop();
        else
            st.push(s[i]-'0');
    }
    cout<<n-st.size();
} 

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

int main() {
  string S;
  int i;
  cin >> S;
  int ans=0;
  if(S[0]==S[1]){
    if(S[1]!=S[2]){
      if(S[2]==S[3])
        ans=1;
    }
  }
  else if(S[1]==S[2]){
    if(S[2]!=S[3]){
      if(S[0]==S[3])
        ans=1;
    }
  }
  else if(S[0]==S[2]){
    if(S[1]==S[3])
      ans=1;
  }
  if(ans==1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

typedef struct _sentence{
  char s[11];
} sentence;

int s_cmp(const void *s1, const void *s2) {
  return strcmp(((sentence*)s1)->s, ((sentence*)s2)->s);
}

int main(void) {
  int n, i, count=1;
  sentence* s;
  scanf("%d", &n);
  s = (sentence*)malloc(sizeof(sentence)*n);
  for(i=0; i<n; i++) {
    scanf("%s", s[i].s);
  }
  qsort(s, n, sizeof(sentence), s_cmp);
  for(i=0; i<n-1; i++) {
    if(strcmp(s[i].s, s[i+1].s) != 0) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}


Measured memory_bytes: 5740
# 計算量O(N2M)
import collections
N = int(input())

d = collections.Counter(list(map(int,input().split())))

M = int(input())
t = list(map(int,input().split()))
t_num = t.copy()
t_num = set(list(t_num))
t = collections.Counter(t)

if N < M:
    print('NO')
    exit()

for key in t_num:
    if d[key] < t[key]:
        print('NO')
        exit()
print('YES')

Measured memory_bytes: 63924
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,k;
string s[11];
int main(){
  while(cin>>n>>k,n){
    set<string>se;
    r(i,n)cin>>s[i];
    sort(s,s+n);
    do{
      string x;
      r(i,k)x+=s[i];
      se.insert(x);
    }while(next_permutation(s,s+n));
    cout<<se.size()<<endl;
  }
}

Measured memory_bytes: 3456
import java.util.Scanner;

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

    int a, b, c, tmp;
    a = stdInt.nextInt();
    b = stdInt.nextInt();
    c = stdInt.nextInt();

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

    System.out.println(a +" " +  b + " " + c);
  }
}


Measured memory_bytes: 26272
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll a,b,c,k;cin>>a>>b>>c>>k;
    ll ans = 0;
    if(k && a)ans+=(min(a,k));
    if(min(a,k)==k)k=0;
    else k-=a;
    if(k && b)ans+=0;
    if(min(b,k)==k)k=0;
    else k-=b;
    if(k && c)ans-=(min(c,k));

         cout<<ans<<endl;

}


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

#define N 8000

using namespace std;

bool dp_x[2*N+1][8000] = {false};
bool dp_y[2*N+1][8000] = {false};

int main(){
    string S;
    int x, y;
    cin >> S;
    cin >> x >> y;
    int cnt_F = 0;
    int cnt_T = 0;
    int cnt_x = 0;
    int cnt_y = 0;
    bool first_F = true;
    for(int i = 0; i < 2*N+1; i++){
        for(int j = 0; j < N; j++){
            dp_x[i][j] = false;
            dp_y[i][j] = false;
        }
    }
    int cnt = 0;
    while(S[cnt] == 'F'){
        cnt++;
    }
    dp_x[cnt+N+1][0] = true;
    dp_y[N+1][0] = true;
    for(int i = cnt; i < S.size(); i++){
        if(S[i] == 'T' || i == S.size()-1){
            if(i == S.size()-1 && S[i] == 'F')cnt_F++;
            if(cnt_F != 0){
                if(cnt_T%2 == 0){
                    cnt_x++;
                    for(int i = 0; i < 2*N+1; i++){
                        if(dp_x[i][cnt_x-1]){
                            dp_x[i+cnt_F][cnt_x] = true;
                            dp_x[i-cnt_F][cnt_x] = true;
                        }
                    }
                }else{
                    cnt_y++;
                    for(int i = 0; i < 2*N+1; i++){
                        if(dp_y[i][cnt_y-1]){
                            dp_y[i+cnt_F][cnt_y] = true;
                            dp_y[i-cnt_F][cnt_y] = true;
                        }
                    }
                }
            }
            cnt_T++;
            cnt_F = 0;
        }
        else{
            cnt_F++;
        }
    }
    if(dp_x[x+N+1][cnt_x] && dp_y[y+N+1][cnt_y]) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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



int main()
{
    
	ios_base::sync_with_stdio(false); cin.tie(NULL);
 

	long long a,b,x;
	cin>>a>>b>>x;
	long long cnt = abs(b/x - a/x);
	if(a%x==0)
		cnt++;
	cout<<cnt<<'\n';
    return 0;
		
}

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

int main()
{
    int n;
    scanf("%d", &n);
    vector<int> a(n + 1);
    a[0] = a[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        a[i] = a[i - 1] + a[i - 2];
    }
    printf("%d\n", a[n]);
}


Measured memory_bytes: 3204
#include <stdio.h>

int main(void)
{
	double weight;
	
	while (scanf("%lf", &weight) != EOF){
		if (weight <= 48.0){
			printf("light fly\n");
		}
		else if (weight <= 51.0){
			printf("fly\n");
		}
		else if (weight <= 54.0){
			printf("bantam\n");
		}
		else if (weight <= 57.0){
			printf("feather\n");
		}
		else if (weight <= 60.0){
			printf("light\n");
		}
		else if (weight <= 64.0){
			printf("light welter\n");
		}
		else if (weight <= 69.0){
			printf("welter\n");
		}
		else if (weight <= 75.0){
			printf("light middle\n");
		}
		else if (weight <= 81.0){
			printf("middle\n");
		}
		else if (weight <= 91.0){
			printf("light heavy\n");
		}
		else {
			printf("heavy\n");
		}
	}
	
	return 0;
}

Measured memory_bytes: 608
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <stack>
#include <map>
#include <set>
#include <queue>
#include <functional>
using namespace std;
typedef long long ll;

class UF{
public:
    int par[100010];
    int ran[100010];

    void init(int n){
        for(int i = 0;i < n;i++){
            par[i] = i;
            ran[i] = 0;
        }
    }

    int find(int x){
        if(par[x] == x)return x;
        else return par[x] = find(par[x]);
    }

    void unite(int x,int y){
        x = find(x);
        y = find(y);

        if(ran[x] < ran[y])par[x] = y;
        else{
            par[y] = x;
            if(ran[x] == ran[y])ran[x]++;
        }
    }

    bool same(int x,int y){
        return find(x) == find(y);
    }
};

int main(){
    int n,m;
    cin >> n >> m;
    UF uf;
    uf.init(n);

    vector<int> p(n);
    map<int,int> dict;
    for(int i = 0;i < n;i++){
        cin >> p[i];
        p[i]--;
        dict[p[i]] = i;
    }

    int cnt = 0;
    for(int i = 0;i < m;i++){
        int x,y;
        cin >> x >> y;

        x--,y--;
        uf.unite(x,y);
    }

    int ans = 0;
    for(int i = 0;i < n;i++){
        if(uf.same(p[i],i) || p[i] == i)ans++;
    }

    cout << ans << endl;
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;

int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    int n, r;
    cin >> n >> r;

    if(n >= 10){
        cout << r << endl;
    }else{
        cout << r+100*(10-n) << endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int k,t,v[101];
    cin>>k>>t;
    if(t==1)
    {
        int x;
        cin>>x;
        cout<<x-1;
    }
    else
    {
        int suma=0;
        for(int i=1; i<=t; i++)
        {
            cin>>v[i];
            suma+=v[i];
        }
        int maxi=v[1],poz=1;
        for(int i=2; i<=t; i++)
        {
            if(maxi<v[i])
            {maxi=v[i];poz=i;}
        }
        suma-=maxi;
        if(maxi>suma+1)
            cout<<maxi-(suma+1);
        else cout<<0;
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        String s = scanner.next();
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != "CODEFESTIVAL2016".charAt(i)) {
                ans++;
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
#define tezi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define loop(i,a,b) for(int i=a;i<b;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define ull unsigned long long
#define traverse(c,it) for(auto it=c.begin();it!=c.end();it++)
#define lowerb(v,a) lower_bound(v.begin(),v.end(),a)
#define lowerbarr(v,n,a) lower_bound(v,v+n,a)
#define upperb(v,a) upper_bound(v.begin(),v.end(),a)
#define upperbarr(v,n,a) upper_bound(v,v+n,a)
#define maxval(v) max_element(v.begin(),v.end())
#define maxarr(v,n) max_element(v,v+n)
#define minval(v) min_element(v.begin(),v.end())
#define minarr(v,n) min_element(v,v+n)
#define sz(a) (ll)a.size()
#define f first
#define s second
#define PI 3.1415926536
#define mem0(v) memset(v,0,sizeof(v))
#define memf(v) memset(v,false,sizeof(v))
#define memt(v) memset(v,true,sizeof(v))
#define mem(v,a) memset(v,a,sizeof(v))
#define npos string::npos
#define inf 1e10;
#define MAX 1000000
#define MOD 1000000007
                   /**************SIEVE****************/

/*bool prime[MAX+1];
vector<ll> v;
void sieve(){ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true.
   
    memset(prime, true, sizeof(prime)); 
  
    for (long p=2; p*p<=MAX; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (long i=p*p; i<=MAX; i += p) 
                prime[i] = false; 
        } 
    } 
  for(int i=0;i<=MAX;i++)if(prime[i])v.pb(i);
  
   
    
   
} 
 
                                        /**************gcd****************/

ll gcd(ll a,ll b) 
{ if(a>b)swap(a,b);
    if (a == 0) 
        return b; 
 return gcd(b%a, a); 
}
 
 
 
                                         /**************POWER****************/
 ll binpow(ll a, ll b) {
    if (b == 0)
        return 1;
    ll res = binpow(a, b / 2)%MOD;
    if (b % 2)
        return ((ull)res * (ull)res * (ull)a)%MOD;
    else
        return ((ull)res * (ull)res)%MOD;
}
   

 
 
 
 
                                     /**************MAIn****************/



int main()
{   
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("put.txt","w",stdout);
  #endif
  int T=1;
  //cin>>T;
  while(T--)
  {

    ll n;
    cin>>n;
    if(n<2){cout<<0;return 0;}
    ll ans=(binpow(10,n)-2*binpow(9,n)+binpow(8,n))%MOD;
    if(ans<0)ans+=MOD;
    cout<<ans;
  

  }    


  
  
      cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}

    

  
 
    
  

   
 
 
 
 
 
  
 
 



Measured memory_bytes: 3784
S = list(input())
T = list(input())
sl = len(S)
tl = len(T)

list1 = []
for i in range(sl-tl+1):
  count = 0
  x = list(zip (T,S[i:(i+tl)]))
 
  for j in range(tl):
    if x[j][0] == x[j][1]:
      count += 1
    list1.append(count)

print(tl - max(list1))

Measured memory_bytes: 14724
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<map>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
#define sort(s) sort(s.begin(),s.end())
#define r(s) reverse(s.begin(),s.end())
#define come return
constexpr auto AC = 0;
using namespace std;
int aa(vector<int> s, int i) {
	rep(j, i) {
		if (s[j] <= s[i])return 0;
	}
	return 1;
}

int main() {
	int a;
	int ans = 0;
	cin >> a;
	vector<int> s(a),t(a);
	
	rep(i, a) {
		cin >> s[i];
		if (i == 0)t[i] = s[i];
		else t[i] = min(t[i - 1], s[i]);

		if (t[i] >= s[i])ans++;
	}
	cout << ans << endl;
	come AC;
}


Measured memory_bytes: 1920
#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main() {
	int a, b, h, m;
	cin >> a >> b >> h >> m;
	
	double x = (h * 30 + m * 0.5) - (m * 6);
	x /= 180;
	x *= 3.141592653589793238462643383279;
	
	printf("%.20lf\n", sqrt(a * a + b * b - 2 * a * b * cos(x)));
	
	return 0;
}

Measured memory_bytes: 4168
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 20000;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    bool ok = 0;
    rep(i,3){
        if (s[i] == '7') ok = 1;
    }
    Yes(ok);
}



Measured memory_bytes: 3652
#include <cstring>
#include <cstdint>
#include <iostream>
#include <string>
#include <memory>
#include <queue>
#include <stack>
#include <limits>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <sstream>
#include <random>
#include <functional>
#include<algorithm>
#include <array>
#include<random>
using namespace std;

class Mesh {
	vector<char> data;
	uint16_t N;
public:
	Mesh(uint16_t aN) :data(aN * aN), N(aN) {

	}

	void set(uint16_t i, uint16_t j, char c) {
		i %= N;
		j %= N;
		data[i + j * N] = c;
	}

	char get(uint16_t i, uint16_t j) {
		i %= N;
		j %= N;
		return data[i + j * N];
	}
};

int main() {
	uint16_t N;
	cin >> N;
	Mesh mesh(N);
	bool allSC = true;
	char bc = '\0';
	for (uint16_t j = 0; j < N; j++)
	{
		for (uint16_t i = 0; i < N; i++)
		{
			char c;
			cin >> c;
			if (bc != '\0') {
				if (bc != c) {
					allSC = false;
				}
			}
			bc = c;
			mesh.set(i, j, c);
		}
	}

	auto cmpMesh = [&](uint16_t a, uint16_t b) {
		for (uint16_t i = 0; i < N; i++)
		{
			for (uint16_t j = 0; j < N; j++)
			{
				if (mesh.get(i + a, j + b) != mesh.get(j + a, i + b))return false;
			}
		}
		return true;
	};

	uint16_t ans = 0;
	for (uint16_t a = 0; a < N; a++)if (cmpMesh(a, 0)) {
		++ans;
	}


	cout << ans * N;
	return 0;
}

Measured memory_bytes: 384
#define _USE_MATH_DEFINES

#include <cmath>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <limits>
#include <cstring>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

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

int num[] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};

int n, m;
int a[10];
int dp[10010];
int INF = (int) 1e9;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        cin >> a[i];
    }
    sort(a, a + m, greater<int>());

    fill(dp, dp + n + 1, -INF);
    dp[0] = 0;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j < m; ++j) {
            int use = num[a[j]];
            if (i - use >= 0) {
                dp[i] = max(dp[i], dp[i - use] + 1);
            }
        }
    }

    int cur = n;
    while(cur > 0){
        for (int j = 0; j < m; ++j) {
            int use = num[a[j]];
            if (cur - use < 0) continue;
            if (dp[cur - use] == dp[cur] - 1){
                cout << a[j];
                cur -= use;
                break;
            }
        }
    }
    cout << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int my_sqrt(int n) {
	long long left,right,mid;
	if(n==0)return 0;
	if(n<0)return -1;
	left=1;right=n;
	while(left<=right) {
		mid=(left+right)/2;
		if(mid*mid==n)return (int)mid;
		else if(mid*mid<n)left=mid+1;
		else right=mid-1;
	}
	return -1;
}

int solve_houteisiki(int* a1,int* a2,int a,int b,int c) {
	int D=b*b-4*a*c;
	int D_sqrt;
	if(D<0)return 0;
	D_sqrt=my_sqrt(D);
	if(D_sqrt<0)return 0;
	*a1=-b-D_sqrt;
	*a2=-b+D_sqrt;
	return 1;
}

int get_gcd(int a,int b) {
	if(a<0)a=-a;
	if(b<0)b=-b;
	if(a<b)return get_gcd(b,a);
	if(b==0)return a;
	return get_gcd(b,a%b);
}

int main(void) {
	int a,b,c;
	int p,q,r,s;
	int gcd;
	int t;
	while(1) {
		scanf("%d%d%d",&a,&b,&c);
		if(a==0 && b==0 && c==0)break;
		p=r=a*2;
		if(!solve_houteisiki(&q,&s,a,b,c)) {
			puts("Impossible");
		} else {
			q=-q;s=-s;
			gcd=get_gcd(p,q);
			p/=gcd;q/=gcd;
			gcd=get_gcd(r,s);
			r/=gcd;s/=gcd;
			if(p<r || (p==r && q<s)) {
				t=p;p=r;r=t;
				t=q;q=s;s=t;
			}
			if(p*r>a || a%(p*r)!=0)puts("Impossible");
			else  {
				gcd=a/(p*r);
				p*=gcd;q*=gcd;
				printf("%d %d %d %d\n",p,q,r,s);
			}
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
#include <bitset>
#include <string>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)


ll modpow(ll x, ll n) {
    if (n == 0) {
        return 1;
    } else if (n % 2 == 0) {
        ll h = modpow(x, n / 2);
        return h * h % MOD;
    } else {
        return x * modpow(x, n - 1) % MOD;
    }
}

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

int main() {
    int a, b; cin >> a >> b;
    int ans = a;
    if (a > b)  ans--;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fin         ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ii          pair<int,int>
#define F           first
#define S           second
#define pb          push_back
#define all(x)      (x).begin(),(x).end()
#define rall(x)     (x).rbegin(),(x).rend()
#define fore(i,a,b) for(int i = a;i < b; i+= 1)
#define forr(i,a)   for(int i = a; i >= 0; i--)
#define fori(i,m)   for(auto i = m.begin(); i != m.end(); i++) 
#define w(t)        while(t--)
#define sz(s)       int(s.size())
#define cls(a,car)  memset(a,car,sizeof (a))
#define db(x)       cerr << #x << " is " << x << '\n'
#define FL          freopen("in", "r", stdin),freopen("out", "w", stdout);
#define EjecuteTime cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define angle(x)    double(x * acos(-1) / 180.0)
using namespace std;
typedef long long   ll;
typedef vector<int> vi;
typedef vector<ii>  vii;
const int N = 2 * 1e5 + 5;
const ll mod = 1e9 + 7;
const double E = 1e-9;
//int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//int dx[] = {2, 1, -1, -2, -2, -1, 1, 2}, dy[] = {1, 2, 2, 1, -1, -2, -2, -1};
// fflush(stdout)
// cout << flush
// a + b = a ^ b + 2 * (a & b)
int main(){
    //FL;
    fin;
    int v[5];
    fore(i, 0, 5)
    cin >> v[i];
    fore(i, 0, 5)
        if(v[i] == 0){
            cout << i + 1 << '\n';
            break;
        }
    EjecuteTime;
    return 0;
}       



Measured memory_bytes: 3796
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  int A,B; cin >> A >> B;
  cout << A*B << endl;
  return 0;
}


Measured memory_bytes: 3596
#include<iostream>

using namespace std;
int AftermoveLogX[250000];
int AftermoveLogY[250000];
int BeforemoveLogX[250000];
int BeforemoveLogY[250000];
int main(void) {
	int h, w;
	int n = 0;
	cin >> h >> w;
	int a[h][w];
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> a[i][j];
		}
	}
	int moveindex;
	moveindex = 0;
	for (int i = 0; i < h - 1; i++) {
		for (int j = 0; j < w; j++) {
			if (a[i][j] % 2 == 1) {
				a[i + 1][j] += 1;
				a[i][j]--;
				n++;
				BeforemoveLogX[moveindex] = j + 1;
				BeforemoveLogY[moveindex] = i + 1;
				AftermoveLogX[moveindex] = j + 1;
				AftermoveLogY[moveindex] = i + 2;
				moveindex++;
			}
		}
	}

	for (int i = 0; i < w-1; i++) {
		if (a[h-1][i] % 2 == 1) {
			a[h-1][i + 1]++;
			a[h-1][i]--;
			BeforemoveLogX[moveindex] = i + 1;
			BeforemoveLogY[moveindex] = h;
			AftermoveLogX[moveindex] = i + 2;
			AftermoveLogY[moveindex] = h;
			moveindex++;
			n++;
		}
	}
	cout << n << endl;

	for (int i = 0; i < moveindex; i++) {
		cout << BeforemoveLogY[i] << " " << BeforemoveLogX[i] << " ";
		cout << AftermoveLogY[i] << " " << AftermoveLogX[i] << endl;
	}
	return 0;

}

Measured memory_bytes: 4992
#include <stdio.h>

int main(void)
{
	int a, b;
	char op;
while(1){
scanf("%d %c %d", &a, &op, &b);
if ( op == '+' ){
	printf("%d\n", a + b);
} else if ( op == '-' ){
	printf("%d\n", a - b);
} else if ( op == '*' ){
	printf("%d\n", a * b);
} else if ( op == '/' ){
	printf("%d\n", a / b);
} else {
	break;
}
}
return 0;
}


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

int popcnt(long long n){
  int c=0;
  while(n>0){
    c+=(n%2);
    n/=2;
  }
  return c;
}

int main(){
  int N; cin >> N;
  string X; cin >> X;
  int px=0;
  for(int i=0; i<N; i++){
    if(X[i]=='1') px++;
  }
  
  vector<long long> resplus(N,0),resminus(N,0);
  resplus[N-1]=1;
  for(int i=N-1; i>0; i--){
    resplus[i-1]=(2*resplus[i])%(px+1);
  }
  if(px>1){
    resminus[N-1]=1;
    for(int i=N-1; i>0; i--){
      resminus[i-1]=(2*resminus[i])%(px-1);
    }
  }
  
  long long baseplus=0,baseminus=0;
  for(int i=0; i<N; i++){
    if(X[i]=='1'){
      baseplus+=resplus[i];
      baseplus%=(px+1);
      if(px>1){
        baseminus+=resminus[i];
        baseminus%=(px-1);
      }
    }
  }
  
  for(int i=0; i<N; i++){
    int count=1;
    if(X[i]=='1')
    {
      //1->0なのでpx--でスタート
      if(px>1){
        int temp=baseminus-resminus[i];
        while(temp<0){
          temp+=(px-1);
        }
        while(temp>0){
          temp%=popcnt(temp);
          count++;
        }
      }else{
        count=0;
      }
    }
    else
    {
      //0->1なのでpx++でスタート
      int temp=(baseplus+resplus[i])%(px+1);
      while(temp>0){
        temp%=popcnt(temp);
        count++;
      }
    }
    cout << count << endl;
  }
}

Measured memory_bytes: 6824
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <tuple>
#include <list>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cstring>
#include <cstdlib>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

#define xx first
#define yy second
#define $1 first
#define $2 second

ll gcd(ll a, ll b) {
	while (b) { int t = a%b; a = b; b = t; } return a;
}

typedef struct _triple{
	int i, j, k;
} T;


void solveCase() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	ll n; string s; cin >> n; cin >> s;
	set< T > st;
	ll r=0, g=0, b=0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'R') r++;
		if (s[i] == 'G') g++;
		if (s[i] == 'B') b++;
	}
	ll ans = r*g*b;
	for (int i = 0; i < n; i++) {
		for (int j = i+1; j < n; j++) {
			int k = j+abs(j - i);
			if (k >= n) continue;

			if (((s[i] != s[j]) && (s[j] != s[k]) && (s[k] != s[i])) && ((j - i) == (k - j))) {
				ans--;
			}
		}
	}
	cout << ans;
}

int main() {

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif
	solveCase();
}

Measured memory_bytes: 3660
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;


namespace AtCoder {
    class Program {
        static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var s = cin.Read;
            WriteLine(s.Count(x=>x=='1'));
        }
    }


    public class ConsoleInput {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputstream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputstream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputstream.Count != 0) return inputstream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (var i = 0; i < tmp.Length; ++i)
                    inputstream.Enqueue(tmp[i]);
                return inputstream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N)
        {
            var ret = new string[N];
            for (long i = 0; i < N; ++i)
                ret[i] = Read;
            return ret;
        }
        public int[] ReadIntArray(long N)
        {
            var ret = new int[N];
            for (long i = 0; i < N; ++i)
                ret[i] = ReadInt;
            return ret;
        }
        public long[] ReadLongArray(long N)
        {
            var ret = new long[N];
            for (long i = 0; i < N; ++i)
                ret[i] = ReadLong;
            return ret;
        }
    }
}


Measured memory_bytes: 13396
import java.util.Random;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    
        long startTime = System.currentTimeMillis();
    
        var sc = new Scanner(System.in);
    
        int D = Integer.parseInt(sc.next());
        var c = new int[27];
        for(int i = 1; i <= 26; i++){
            c[i] = Integer.parseInt(sc.next());
        }
        var s = new int[D+1][27];
        for(int d = 1; d <= D; d++){
            for(int i = 1; i <= 26; i++){
                s[d][i] = Integer.parseInt(sc.next());
            }
        }
    
        var t = new int[D+1];
        for(int d = 1; d <= D; d++){
            t[d] = (d-1)%26+1;
        }
        long maxScore = Long.MIN_VALUE;
        var max = new int[D+1];
        var rand = new Random();
        while(true){
            long score = 0;
            var last = new int[27];
            for(int d = 1; d <= D; d++){
                score += s[d][t[d]];
                last[t[d]] = d;
                for(int i = 1; i <= 26; i++){
                    score -= c[i] * (d - last[i]);
                }
            }
            if(score > maxScore){
                maxScore = score;
                max = t.clone();
            }
            long elapsedTime = System.currentTimeMillis() - startTime;
            if(elapsedTime > 1800) break;
            for(int d = 1; d <= D; d++){
                t[d] = rand.nextInt(26)+1;
            }
        }
        
        var sb = new StringBuilder();
        for(int i = 1; i <= D; i++){
            sb.append(max[i]).append(System.lineSeparator());
        }
        System.out.print(sb);
    }
}

Measured memory_bytes: 54936