akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<int, pair<int, int>> PP;
typedef pair<P, int> PPi;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1e+9 + 7;
// constexpr int mod = 998244353;

template<class T>
struct CumulativeSum2D{
    vector<vector<T>> data;

    CumulativeSum2D(int W, int H) : data(W + 1, vector<int>(H + 1, 0)) {}

    void add(int x, int y, T z){
        ++x, ++y;
        if(x >= data.size() || y >= data[0].size()) return;
        data[x][y] += z;
    }

    void build(){
        for(int i = 1; i < data.size(); ++i){
            for(int j = 1; j < data[i].size(); ++j){
                data[i][j] += data[i][j - 1] + data[i - 1][j] - data[i - 1][j - 1];
            }
        }
    }

    T query(int sx, int sy, int gx, int gy){
        return (data[gx][gy] - data[sx][gy] - data[gx][sy] + data[sx][sy]);
    }
};

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

    int n, m, q;
    cin >> n >> m >> q;
    CumulativeSum2D<int> S(n, n);
    for(int i = 0; i < m; ++i){
        int l, r;
        cin >> l >> r;
        --l, --r;
        S.add(l, r, 1);
    }
    S.build();
    for(int i = 0; i < q; ++i){
        int l, r;
        cin >> l >> r;
        --l;
        cout << S.query(l, l, r, r) << endl;
    }
}

Measured memory_bytes: 1920
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

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

    int ans = -1;
    for(int bit = 0; bit < (1 << n); bit++){
        vector<int> rikai(m, 0);
        int coans = 0;
        for(int i = 0; i < n; i++){
            if(bit & (1 << i)){
                for(int j = 0; j < m; j++) rikai[j] += a[i][j];
                coans += c[i];
            }
        }

        bool isok = true;
        for(int i = 0; i < m; i++){ 
            if(rikai[i] < x) isok = false;
        }

        if(isok){
            if(ans == -1) ans = coans;
            else if(ans > coans) ans = coans;
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <map>

//入力
#define in(N) cin >> N
#define in2(N,M) in(N) >> M
#define in3(N,M,K) in2(N,M) >> K
#define in4(N,M,K,L) in3(N,M,K) >> L
//出力
#define out(ans) cout << (ans) << endl
#define out2(a,b) cout << (a) << " " << (b) << endl
#define out3(a,b,c) cout << (a) << " " << (b) << " " << (c) << endl
#define outf(ans) cout << fixed << setprecision(6) << (ans) << endl

#define rep(i,n) for(int i=0; i<n; i++) //n回ループ
#define all(v) v.begin(), v.end() //vectorの全体を指定
#define sort_g(A,T) sort(all(A),greater<T>()) //降順ソート

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vstr;
const ll mod=1e9+7;

int main(){
	ll X;
	in(X);
	ll money=100;
	ll count = 0;
	while(money<X){
		money = (ll)(money * 1.01);
		count++;
	}

	out(count);
	return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main(void) {

	// TODO: submit前にprintf-debugの削除確認！
	int N;
	cin >> N;

	long long unsigned int A[N+1];
	A[0] = 0;
	int midIdx = 0;
	for(int i=1; i<=N; i++) {
		long long unsigned int a;
		cin >> a;
		A[i] = A[i-1] + a;
	}

	long long unsigned int ans = A[N];
	for(int i=1; i<N; i++) {
		long long unsigned int left = A[i];
		long long unsigned int right = A[N] - A[i];

		long long unsigned int cost = 
			left  > right ?
			left  - right :
			right - left;

		ans = min(ans, cost);
	}

	cout << ans <<endl;

	return 0;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	std::string s; cin >> s;
	
	if(s.size() & 1) {
		printf("No\n");
		return 0;
	}

	for(int i = 0; i < s.size(); i += 2) {
		if(s.substr(i, 2) == "hi") continue;
		printf("No\n");
		return 0;
	}
	
	printf("Yes\n");
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define double long double
#define int long long
#define mi map<int,int>
#define pii pair<int,int>
#define low lower_bound
#define upp upper_bound
#define mod (int)1e9+7
#define inf (int)1e16
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) vsort(vec); vrever(vec);
#define bisea binary_search
#define cend cout<<endl;
#define F first
#define S second
#define P pair<int,int>
#define prique priority_queue<P,vector<P>,greater<P>>
using namespace std;
int n,m,ans=0;
int x[1010],y[1010],z[1010];
int f(bool x) {
  if(x) return 1;
  return -1;
}
signed main() {
  cin>>n>>m;
  rep(i,n) {
    int a,b,c;
    cin>>a>>b>>c;
    x[i]=a;
    y[i]=b;
    z[i]=c;
  }
  int ans=0;
  for(int i=0;i<(1<<3);i++) {
    int cnt[1010];
    int sum=0;
    rep(j,n) {
      cnt[j]=x[j]*f((i>>0)&1)+y[j]*f((i>>1)&1)+z[j]*f((i>>2)&1);
    }
    sort(cnt,cnt+n);
    reverse(cnt,cnt+n);
    rep(j,m) sum+=cnt[j];
    ans=max(ans,sum);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int i, j, n, S, r[20000], ans;
	while(1){
		scanf("%d%d",&n,&S);

		if(n == 0 && S == 0){
			break;
		}


		for(i = 0;i < n;i++){
			scanf("%d",&r[i]);
		}

		ans = 0;

		for(i = 0;i < n;i++){
			for(j = i + 1;j < n;j++){
				if(S < r[i] + r[j]){
					ans++;
				}
			}
		}
		printf("%d\n",ans);

	}

	return 0;
}

Measured memory_bytes: 1072
import heapq

n, m = map(int, input().split())
an = list(map(int, input().split()))

an = [-1 * i for i in an]

heapq.heapify(an)

for _ in range(m):
    x = heapq.heappop(an)
    x = int(x/2)
    heapq.heappush(an, x)

print(-1 * sum(an))

Measured memory_bytes: 14184
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
#include<bits/stdc++.h>
using namespace std;
#define y1 y11
#define fi first
#define se second
#define pi acos(-1.0)
#define LL long long
//#define mp make_pair
#define pb emplace_back
#define ls rt<<1, l, m
#define rs rt<<1|1, m+1, r
#define ULL unsigned LL
#define pll pair<LL, LL>
#define pli pair<LL, int>
#define pii pair<int, int>
#define piii pair<pii, int>
#define pdd pair<double, double>
#define mem(a, b) memset(a, b, sizeof(a))
#define debug(x) cerr << #x << " = " << x << "\n";
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//head

int n;
vector<pii> vc;
vector<int> vc1;
int main() {
    scanf("%d", &n);
    if(__builtin_popcount(n) == 1) return 0*puts("No");
    vc.pb(n+1, n+2);
    vc.pb(n+2, n+3);
    vc.pb(n+3, 1);
    vc1.pb(n+3);
    vc.pb(1, 2);
    vc1.pb(2);
    vc.pb(2, 3);
    for (int i = 4; i < n; i += 2) {
        vc.pb(1, i);
        vc1.pb(i);
        vc.pb(i, i+1);

        vc.pb(1, n+i+1);
        vc1.pb(n+i+1);
        vc.pb(n+i+1, n+i);
    }
    sort(vc1.begin(), vc1.end());
    if(n%2 == 0) {
        for (int i = 2; i < n; ++i) {
            if((n^1^i) < n && 1 < (n^1^i)) {
                int x = i;
                int y = n^1^i;
                if(lower_bound(vc1.begin(), vc1.end(), x) != vc1.end() && *lower_bound(vc1.begin(), vc1.end(), x) == x) vc.pb(x, n);
                else vc.pb(n+x, n);
                if(lower_bound(vc1.begin(), vc1.end(), y) != vc1.end() && *lower_bound(vc1.begin(), vc1.end(), y) == y) vc.pb(y, n+n);
                else vc.pb(n+y, n+n);
                break;
            }
        }
    }
    puts("Yes");
    for (auto it : vc) printf("%d %d\n", get<0>(it), get<1>(it));
    return 0;
}


Measured memory_bytes: 4848
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    int n,a,b;
    cin >> n >> a >> b;
    int ans=0;
    repi(i,1,n+1){
        int ii=i;
        int sum=0;
        while(ii>0){
            sum+=ii%10;
            ii/=10;
        }
        if(a<=sum&&sum<=b) ans+=i;
    }
    print(ans);
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3636
#include "bits/stdc++.h"
#include  <iostream>
 using namespace std;
 
#define IOS         ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define FOR(i,a,n)  for(int i = (a); i<(n); ++i) 
#define mp(a , b)   make_pair(a , b)
#define pb(a)       push_back(a)
#define si(n)       scanf("%d" , &n)
#define pi(n)       printf("%d", n )
#define sl(n)       scanf("%lld" ,&n)
#define pl(n)       printf("%lld",n)
#define pin(n)      printf("%d\n", n)
#define pis(n)      printf("%d ", n)
#define pln(n)      printf("%lld\n", n)
#define endl "\n"

typedef long long ll;
 
 

int main(){
     
    IOS;
    
  //  freopen("input.in", "r", stdin);
   // freopen("output.in", "w", stdout);
   
   set<int > s1 , s2;
   
   int n, m;
   cin>>n>>m;
   
    int a[m] , b[m];

    FOR(i,0,m) {

      cin>>a[i]>>b[i];
       
      if(a[i]==1)  s1.insert(b[i]);

      if(b[i]==n)   s2.insert(a[i]);
  }

  auto it = s1.begin();
  auto it1 = s2.begin();

 
   for(it; it!= s1.end(); it++){
  	if(s2.count(*it)) {
  		cout<<"POSSIBLE";
  		return 0;
  	}
  }
    cout<<"IMPOSSIBLE";

  return  0 ;


}


Measured memory_bytes: 11264
/*
USER: caoash3
LANG: JAVA
TASK: 
*/

import java.io.*;
import java.util.*;

public class Main {

	static final boolean stdin = true;
	static final String filename = "";
	static FastScanner br;
	static PrintWriter pw;

	public static void main(String[] args) throws IOException {

		if (stdin) {
			br = new FastScanner();
			pw = new PrintWriter(new OutputStreamWriter(System.out));
		}

		else {
			br = new FastScanner(filename + ".in");
			pw = new PrintWriter(new FileWriter(filename + ".out"));
		}

		X solver = new X();
		solver.solve(br, pw);
	}

	static class X {
		
		static ArrayList<Integer> ts;
		static ArrayList<Integer>[] edges;
		static boolean[] vis;
		static int N,M;
		
		public void solve(FastScanner br, PrintWriter pw) throws IOException {
			
			N = br.nextInt();
			M = br.nextInt();
			edges = new ArrayList[N];
			ts = new ArrayList<Integer>();
			vis = new boolean[N];
			
			for(int i = 0; i < N; i++) {
				edges[i] = new ArrayList<Integer>();
			}
			
			for(int i = 0; i < M; i++) {
				int x = br.nextInt();
				int y = br.nextInt();
				x--;
				y--;
				
				edges[x].add(y);
			}
			
			for(int i = 0; i < N; i++) {
				if(!vis[i]) {
					dfs(i);
				}
			}
			
			Collections.reverse(ts);
			
			int[] dp = new int[N];
			
			for(int curr : ts) {
				for(int e : edges[curr]) {
					dp[e] = Math.max(dp[e], dp[curr]+1);
				}
			}
			int ans = 0;
			for(int i = 0; i < dp.length; i++) {
				ans = Math.max(ans, dp[i]);
			}
			
			pw.println(ans);
			
			pw.close();
		}
		
		public static void dfs(int v) {
			vis[v] = true;
			for(int u : edges[v]) {
				if(vis[u]) {
					continue;
				}
				dfs(u);
			}
			
			ts.add(v);
		}

	}

	//fastscanner class
	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}

}
 



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

typedef long long ll;

int s;
vector<int> a;

int main(){
    cin >> s;

    a.push_back(s);

    while (true){
        int temp = a.back();
        if (temp % 2 == 0){
            temp /= 2;
        } else {
            temp = temp*3 + 1;
        }

        auto itr = find(a.begin(), a.end(), temp);

        if (itr != a.end()){
            cout << a.size()+1 << endl;
            break;
        }
        a.push_back(temp);

    }

    return 0;
}

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

using namespace std;

#define REP(i, N) for (int (i) = 0; (i) < (N); ++(i))
#define READALL(c) for (auto &e : c) { cin >> e; }
#define PRINTALL(c) for (const auto &e : c) { cout << e << "\t"; } cout << "\n";

template <typename T>
using V = vector<T>;

typedef long double ld;
typedef long long ll;


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

	int64_t N;
	cin >> N;
	V<int64_t> A(N);
	READALL(A);

	set<pair<int64_t, int64_t>> events;
	int64_t above = N, below = 0;
	int64_t ans = 1e18, last = -1e10, score = 0;
	REP(i, N) {
		score += abs(A[i]-(i+1+last));
		events.emplace(A[i]-(i+1), i);
	}


	while (events.size()) {
		int64_t base, i;
		tie(base, i) = *events.begin();
		int64_t diff = base-last;
		int64_t cnt = 0;
		while (events.size() && events.begin()->first == base) {
			int64_t base, i;
			tie(base, i) = *events.begin();
			++cnt;
			events.erase(events.begin());
		}
		score += below*diff;
		score -= above*diff;
		ans = min(ans, score);
		above -= cnt;
		below += cnt;
		last = base;
		// cout << above << " " << below << endl;
		// cout << base << " " << events.size() << " " << diff << " " << score << endl;
	}

	cout << ans << endl;
	
}

Measured memory_bytes: 14336
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())

using namespace std;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

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

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

using ll = long long;
constexpr int mod = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u * v / gcd(u, v);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;
    C *= 2;
    int ans = 0;

    //AとBを買うほうが安い
    if (A + B < C) {
        ans += A * X;
        ans += B * Y;
    }
    else {
        int buy = min(X, Y);
        ans += buy * C;
        X -= buy;
        Y -= buy;
        int remain = min(X*A + Y * B, max(X, Y)*C);
        ans += remain;
    }


    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 256
# 問題読んでないけど一行にして折り返して繰り返すみたいなのでいいのでは
h, w = map(int, input().split())
n = int(input())
arr = list(map(int, input().split()))
line = []
for i in range(n):
    line.extend([str(i + 1)] * arr[i])

r = 0
for y in range(h):
    output = line[r : r + w]
    r += w
    if y % 2 == 1:
        print(" ".join(output[::-1]))
    else:
        print(" ".join(output))



Measured memory_bytes: 3700
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
using namespace std;

int main() {

    string S;
    cin >> S;

    int res = 0;
    for (int i=0; i<4; i++) {
        if (S[i] == '+') res++;
        else res--;
    }
    
    cout << res << endl;

}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , 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; }
 
struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Timer TM;

    string s,t;
    cin>>s>>t;
    cout<<t<<s<<endl;

    return 0;
}

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


int main() {
	int k, s;
	int x = 0; //xが答えである
	cin >> k >> s;
	for (int i = 0; i <= k; i++) { //Xがiであった場合を考えると、Y+Z=S-iである
		for (int j = 0; j <= k; j++) { //Yがjであった場合を考えると、Z=S-i-jだが、0<=Z<=k
			if (0 <= s - i - j && s - i - j <= k) x++;
		}
	}
	cout << x << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#define ll long long
#define N 100005
#define inf 1000000005
#define mod 1000000007
#include <map>
#include <bitset>
#define put putchar('\n')
using namespace std;
inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();}
int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;}
inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');}
int p,n,m,a,sum;
bitset<4000005> f;
int main(){
	//freopen(".in","r",stdin);freopen(".out","w",stdout);
	n=read();
	f[0]=1;
	for (int i=1;i<=n;i++){
		a=read();sum+=a;
		f|=f<<a;
	}
	p=(sum+1)/2;
	for (int i=(sum+1)/2;!f[i];i++)p=i+1;
	printf("%d",p);
	return 0;
}

Measured memory_bytes: 1792
def main():
    s = input()
    if s.count('C') == 0 or s.count('F') == 0:
        print('No')
        return
    l = len(s)
    s = s[s.find('C'):]
    if s.count('F') == 0:
        print('No')
    else:
        print('Yes')
main()

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

#include <iostream>

#include <iostream>
#include <limits>
#include <vector>

class CExceptionHandling
{
public:
    void solve(std::istream& in, std::ostream& out)
    {
        int N;
        in >> N;

        std::vector<int> A(N);
        std::vector<int> mn(2, std::numeric_limits<int>::min());

        for (int i = 0; i < N; ++i)
        {
            in >> A[i];
            if (A[i] > mn[0])
            {
                mn[1] = mn[0];
                mn[0] = A[i];
            }
            else if (A[i] > mn[1])
                mn[1] = A[i];
        }

        for (int i = 0; i < N; ++i)
            out << (A[i] == mn[0] ? mn[1] : mn[0]) << '\n';
    }
};


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


Measured memory_bytes: 2432
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(),(v).end()
#define out(a) cout << (a) << endl
using namespace std;
using ll = long long;
int main(){
    string a, b;
    cin >> a >> b;
    string c = a + b;
    int x = stoi(c);
    double num = sqrt(x);
    if (floor(num) == num) out("Yes");
    else out("No");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  vector<pair<ll, ll>> v(n);
  rep(i, 0, n) cin >> v[i].first >> v[i].second;
  ll ans = 0;
  repr(i, 0, n) {
    ll t = v[i].first + ans;
    if (t % v[i].second)
      ans += v[i].second - (t % v[i].second);
  }

  cout << ans << endl;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define Rep(i, N) for(int i = 0; i < N; i++)
#define Reps(i, x, N) for(int i = x; i < N; i++)

inline int llabs(int n) { return n < 0 ? -n : n; }

signed main()
{
  int N;
  
  int maxs = 1;
  cin >> N;
  
  //10^6だけまわるよ
  for(int i = 2; i * i <= N; i++) {
    if(N % i == 0) {
      maxs = i;
    }
  }

  int val = N / maxs;
  int cnt = 0;
  while(val) {
    cnt++, val /= 10;
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    int n, m;
    cin >> n >> m;

    V(bool) nums(n, false);
    vi was(n, 0);
    int ac = 0, wa=0;

    rep(i, m) {
        int p;
        string s;
        cin >> p >> s;
        p--;

        if(s == "AC") {
           if(!nums[p]) {
               nums[p] = true;
               ac++;
               wa += was[p];
            }   
        } else if(!nums[p]) was[p]++;
    }
    

    cout << ac << " " << wa << endl;
    return 0;
}

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

int main(){
  int n,m,t,p;

  while(1){
    cin >> n >> m >> t >> p ;

    if(n==0 && m==0 && t==0 && p==0){
      break;
    }

    int Ori[64][64] = {{0}};
    for(int y=0;y<m;y++){
      for(int x=0;x<n;x++){
        Ori[y][x] = 1;
      }
    }

    for(int i=0;i<t;i++){
      int d,c;
      cin >> d >> c;

      if(d==1){
        for(int x=0;x<c;x++){
          for(int y=0;y<m;y++){
            Ori[y][2*c-1-x] += Ori[y][x];
            Ori[y][x] = 0;
          }
        }

        for(int x=0;x<n;x++){
          for(int y=0;y<m;y++){
            Ori[y][x] = Ori[y][x+c];
            Ori[y][x+c] = 0;
          }
        }
      }
      else{
        for(int y=0;y<c;y++){
          for(int x=0;x<n;x++){
            Ori[2*c-1-y][x] += Ori[y][x];
            Ori[y][x] = 0;
          }
        }

        for(int y=0;y<m;y++){
          for(int x=0;x<n;x++){
            Ori[y][x] = Ori[y+c][x];
            Ori[y+c][x] = 0;
          }
        }
      }
    }

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

      cout << Ori[y][x] << endl;
    }
  }

  return 0;
}



Measured memory_bytes: 3068
#!/usr/bin/env python3
import sys
from itertools import chain
import numpy as np

# from itertools import combinations as comb
# form bisect import bisect_left, bisect_right, insort_left, insort_right
# from collections import Counter


def solve(N: int, A: "List[int]", B: "List[int]"):
    A = sorted(A)
    B = sorted(B)
    if N % 2 == 1:
        l = A[N // 2]
        r = B[N // 2]
        return r - l + 1
    else:
        l2 = A[N // 2 - 1] + A[N // 2]
        r2 = B[N // 2 - 1] + B[N // 2]
        return r2 - l2 + 1


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, A, B = map(int, line.split())
    N = int(next(tokens))  # type: int
    AB = np.array(list(map(int, tokens)), dtype=np.int32)
    A = AB[0::2]
    B = AB[1::2]
    answer = solve(N, A, B)
    print(answer)


if __name__ == "__main__":
    main()


Measured memory_bytes: 101276
#include<iostream>
#include<string>
using namespace std;

int main() {
	int a;
	cin >> a;
	double ans = 0;
	double x;
	string u;
	while(a--){
		cin >> x >> u;
		if (u == "JPY") {
			ans += x;
		}
		else {
			x *= 380000;
			ans += x;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
int main(){
  long long n, m, t;
  std::cin >> n; std::cin >> m;
  
  // don't forget
  if (n == 1 || m == 1){
  	t = 1;
  }else{
	t = (n/2*2) * (m/2*2) /2;
  
    if (n%2==1 && m%2==1){
      t += m / 2 + n / 2 + 1;
    }else if (n%2 == 1){
      t += m / 2 + m % 2;
    }else if (m%2 == 1){
      t += n / 2 + n % 2;
    }

  }
  std::cout << t << std::endl;

}

Measured memory_bytes: 3176
#include<iostream>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<functional>
#include<vector>
#include<map>
#include<set>
#pragma warning(disable:4996)；

using namespace std;
#define ll long long
int num[3];

int main() {
	std::ios::sync_with_stdio(false);
    cin>>num[0]>>num[1]>>num[2];
    sort(num,num+3);
    cout<<num[2]*10+num[1]+num[0];




	return 0;

}


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

using namespace std;

#define INF (int)(1e9)

// The recurrence we will be optimizing is
// c(n) = min(c(n - 1) + cost(n, n - 1),
//            c(n - 2) + cost(n, n - 2))

// h[i] is the "value" of stone i
// cost(i, j) = abs(h[i] - h[j])

// I think this way is more natural
int solve_backwards(const vector<int> &h, int N) {
	if (N < 0)
		return INF;
	if (N == 0)
		return 0;

	return min(solve_backwards(h, N - 1) + abs(h[N] - h[N - 1]),
		   solve_backwards(h, N - 2) + abs(h[N] - h[N - 2]));
}

int solve_forwards(const vector<int> &h, int N) {
	if ((size_t)N >= h.size())
		return INF;
	if ((size_t)N == h.size() - 1)
		return 0;

	return min(solve_forwards(h, N + 1) + abs(h[N] - h[N + 1]),
		   solve_forwards(h, N + 2) + abs(h[N] - h[N + 2]));
}

// position -> cost
// the shortest path to i will inform us about the shortest
// path to get to i + 1 and i + 2
// this will solve to the shortest path to N in general
// This is really just adding a cache to the original
// brute force recurrence
// Easiest way to apply DP in general
unordered_map<int, int> map_dp;
int solve_memo(const vector<int> &h, int N) {
	if (N < 0)
		return INF;
	if (N == 0)
		return 0;
	if (map_dp.find(N) != map_dp.end())
		return map_dp[N];

	return min(solve_memo(h, N - 1) + abs(h[N] - h[N - 1]),
		   solve_memo(h, N - 2) + abs(h[N] - h[N - 2]));
}

// Same idea as last time
// Instead of doing it top down, we will do it bottom up
// Building up smaller values of this optimization first and using
// them to find the answer for N
// This is just changing the order
// You need to know the order of your computations for this to work.
// This case is easy. Generally this means topologically sorting your
// computations
// If this is hard, you may just want to do something like solve_memo.
int solve_tab(const vector<int> &h, int N) {
	vector<int> dp(N);

	// Initial conditions
	dp[0] = 0;
	// This is here because so
	// the recurrence doesn't reach too
	// far back with indices
	dp[1] = abs(h[0] - h[1]);

	// Original recurrence
	for (int i = 2; i <= N; ++i) {
		dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]),
			    dp[i - 2] + abs(h[i] - h[i - 2]));
	}

	return dp[N - 1];
}

int main() {

	cin.tie(NULL);
	ios_base::sync_with_stdio(false);

	int N;
	cin >> N;
	vector<int> h(N);
	for (auto &e : h) {
		cin >> e;
	}
	// cout << solve_backwards(h, N - 1) << '\n';
	// cout << solve_forwards(h, 0) << '\n';
	// cout << solve_memo(h, N - 1) << '\n';
	cout << solve_tab(h, N) << '\n';

	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin() , v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)


int main(){
    string s, ts="CODEFESTIVAL2016"; cin >> s;
    int cnt=0;
    rep(i, s.length()){
        if(s[i] != ts[i]) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define mod 1000000007
using ll = long long;
using namespace std;
int main(){
  int n;
  cin >> n;
  map<int, int> juhuku;
  rep(i, n){
    int d;
    cin >> d;
    juhuku[d]++;
  }
  cout << juhuku.size() << endl;
}

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

int main() {

  long long int in;

  while( true ) {

    cin >> in;

    if ( in == -1 ) break;

    double x = 0.50 * in;

    while( abs( x * x * x - in ) >= 0.00001 * in ) {

      x = x - ( x * x * x - in ) / ( x * x * 3 );

    }

    cout << fixed << setprecision(8) << x << endl;

  }

  return 0;

}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)

const ll MOD = 10007;
const ll HIGHINF = (ll)1e18;

vll forest(100000, -1);
vvll nodes(100000, vll());
vll a(100000);
V<bool> used(100000, false);

ll dfs(ll i, ll k) {
  ll mini = i;
  REP(nxt, nodes.at(i).size()) {
    if (forest.at(nodes.at(i).at(nxt)) == -1) {
      forest.at(nodes.at(i).at(nxt)) = k;
      ll ci = dfs(nodes.at(i).at(nxt), k);
      if (a.at(mini) > a.at(ci)) mini = ci;
    }
  }
  return mini;
}

int main() {
  ll n, m; cin >> n >> m;
  REP(i, n) cin >> a.at(i);
  REP(i, m) {
    ll x, y; cin >> x >> y;
    nodes.at(x).push_back(y);
    nodes.at(y).push_back(x);
  }
  if (m == n-1) cout << 0 << endl;
  else if (n < 2*(n-m-1)) cout << "Impossible" << endl;
  else {
    ll k = 0;
    REP(i, n) {
      if (forest.at(i) == -1) {
        forest.at(i) = k;
        ll mini = dfs(i, k);
        used.at(mini) = true;
        k++;
      }
    }
    ll ans = 0, c = 0;
    priority_queue<ll, vll, greater<ll>> pq;
    REP(i, n) {
      if (!used.at(i)) pq.push(a.at(i));
      else {
        ans += a.at(i); c++;
      }
    }
    REP(i, 2*(n-m-1)-c) {
      ans += pq.top(); pq.pop();
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 8956
#include <iostream>
#include <queue>
using namespace std;
enum Query
{
    insert = 0,
    getMax = 1,
    deleteMax = 2,
};
std::istream &operator>>(std::istream &is, Query &i)
{
    int tmp;
    if (is >> tmp)
        i = static_cast<Query>(tmp);
    return is;
}
int main()
{
    typedef priority_queue<int> que;
    int n;
    cin >> n;
    vector<que> Q(n);

    int q;
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        Query query;
        int t;
        cin >> query >> t;
        que &qt = Q.at(t); //この&何か忘れた

        if (query == insert)
        {
            //qtにxを挿入
            int x;
            cin >> x;
            qt.push(x);
        }
        if (query == getMax)
        {
            //空ならなにもしない
            if (!qt.empty())
            {
                //qtの中で最も大きい要素を報告
                cout << qt.top() << endl;
            }
        }
        if (query == deleteMax)
        {
            //空の時はなにもしない
            if (!qt.empty())
            {
                //qtの中で最も大きい要素を削除
                qt.pop();
            }
        }
    }
}


Measured memory_bytes: 4048
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public static void Main( )
    {
        long N = long.Parse( Console.ReadLine( ) );
        var A = Console.ReadLine( ).Split( ).Select( long.Parse ).ToArray( );
        var B = Console.ReadLine( ).Split( ).Select( long.Parse ).ToArray( );

        Console.WriteLine( Solve( 0, A, B, 0 ) );
    }

    static long Solve( long i, long[] A, long[] B, long ans )
    {
        if ( i == B.Length ) return ans;
        var a = A[ i ];
        var b = B[ i ];
        long cnt;
        ans += cnt = Math.Min( a, b );
        ans += cnt = Math.Min( b - cnt, A[ i + 1 ] );
        A[ i + 1 ] -= cnt;

        return Solve( i + 1, A, B, ans );
    }
}



Measured memory_bytes: 41944
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
random_device rnd;
mt19937 mt(rnd());
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1000000007;

int main()
{
    int n, d, x;
    cin >> n >> d >> x;
    VVI p(d, VI(n));
    rep(i, d)
    {
        rep(j, n)
        {
            cin >> p[i][j];
        }
    }
    VI has(n, 0);
    rep(i, d - 1)
    {
        //cerr<<x<<endl;

        rep(j, n)
        {
            //  cerr<<has[j]<<" ";
            x += has[j] * p[i][j];
            has[j] = 0;
        }
        //cerr<<endl;
        //cerr<<" "<<x<<endl;

        vector<int> pro(n);
        rep(j, n)
        {
            int mx = -1;
            // rep(k, i + 1, d)
            // {
            //     chmax(mx, p[k][j] - p[i][j]);
            // }
            pro[j] = p[i+1][j]-p[i][j]; ///(double)p[i][j];
        }

        pair<int, int> dp[101010];
        rep(i, 101010)
        {
            dp[i] = {0, -1};
        }
        rep(j, n)
        {
            rep(k, 101010)
            {
                if (k + p[i][j] >= 101010)
                {
                    break;
                }
                auto cost = dp[k].first;
                if (cost + pro[j] > dp[k + p[i][j]].first)
                {
                    dp[k + p[i][j]] = {cost + pro[j], j};
                }
            }
        }
        VI stocks={};
        int cur=x;
        while(dp[cur].second!=-1){
            stocks.push_back(dp[cur].second);
            cur-=p[i][dp[cur].second];
        }
        for (auto item:stocks){
            //cerr<<item<<" ";
            has[item]++;
            x-=p[i][item];
        }
        //cerr<<endl;
        assert(x>=0);
        //cerr<<" "<<x<<endl;
    }
    rep(j, n)
    { //cerr<<has[j]<<" ";
        x += has[j] * p[d - 1][j];
    } //cerr<<endl;
    cout << x << endl;
    return 0;
}


Measured memory_bytes: 4020
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

const int WMAX = 2e5;

int h,w,n;
vector<int> dia[2 * WMAX + 5];
vector< pair<int,int> > obstacles;

int main(){
	
	
	cin >> h >> w >> n;
	
	for(int i = 1;i <= n;i++){
		int x,y;
		cin >> x >> y;
		dia[h - x + y].push_back(x);
		obstacles.push_back({x,y});
	}
	
	for(int i = 1;i <= w;i++){
		dia[h - (h + 1) + i].push_back(h + 1);
		obstacles.push_back({h + 1,i});
	}
	
	for(int i = 0;i <= 2 * WMAX + 2;i++){
		sort(dia[i].begin(),dia[i].end());
	}
	
	sort(obstacles.begin(),obstacles.end());
	
	for(auto it:obstacles){
		int x = it.first - 1;
		int y = it.second;
		
		if(x < y){
			continue;
		}
		
		if(dia[h - x + y].empty() || dia[h - x + y][0] > x){
			cout << x;
			return 0;
		}
	}
		
	return 0;
}

Measured memory_bytes: 22256
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<algorithm>
using namespace std;

int main(){
  int n, h, w;
  std::cin >> n;
  for (int roop = 0; roop < n; roop++) {
    std::cin >> h >> w;
    vector<string> vs(h);
    set<char> s;
    for (int i = 0; i < h; i++) {
      std::cin >> vs[i];
      for (int j = 0; j < vs[i].length(); j++) {
        if('A' <= vs[i][j] and vs[i][j] <= 'Z')s.insert(vs[i][j]);
      }
    }
    vector<char> perm;
    for (auto i: s) perm.push_back(i);
    if(perm.size() == 0){
      std::cout << "SAFE" << std::endl;
      continue;
    }
    bool f = false;
    do{
      // for (int i = 0; i < perm.size(); i++) {
      //   std::cout << perm[i] << " ";
      // }
      // std::cout << std::endl;
      vector<string> tmp = vs;
      bool flag = true;
      for (int i = 0; i < perm.size(); i++) {
        int lux = 1e9, luy = 1e9, rdx = 0, rdy = 0;
        for (int j = 0; j < h; j++) {
          for (int k = 0; k < w; k++) {
            flag = false;
            if(tmp[j][k] == perm[i]){
              lux = min(lux, k);
              luy = min(luy, j);
              rdx = max(rdx, k);
              rdy = max(rdy, j);
            }
          }
        }
        if(flag)continue;
        // printf("luy:%d rdy:%d lux:%d rdx:%d\n", luy, rdy, lux, rdx);
        for (int j = luy; j <= rdy; j++) {
          for (int k = lux; k <= rdx; k++) {
            if(tmp[j][k] == '.' or 
               (tmp[j][k] != perm[i] and tmp[j][k] != '$')){
              i = j = k = 1e9;
              continue;
            }
            tmp[j][k] = '$';
          }
        }
        if(i == perm.size() - 1){
          if(not f)std::cout << "SAFE" << std::endl;
          f = true;
        }

      //   for (int j = 0; j < h; j++) {
      //     std::cout << tmp[j] << std::endl;
      //   }
      //   std::cout << std::endl;
      }
    }while(next_permutation(perm.begin(), perm.end()));
    if(not f)std::cout << "SUSPICIOUS" << std::endl;
  }
  return 0;
}

Measured memory_bytes: 3024
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
//#define mp make_pair
#define pb push_back
#define int long long
#define pi 3.141592653589793238462643383279502
#define M 998244353
#define F first
#define S second
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
bool isPowerOfTwo(int n)
{
   if(n==0)
   return false;

   return (ceil(log2(n)) == floor(log2(n)));
}
int power(int x, unsigned int y)
{
    int res = 1;

    x = x;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%M;

        y = y>>1;
        x = (x*x)%M;
    }
    return res%M;
}
bool isprime(int x)
{
      if(x<2)
        return false;
    for(int i=2;i*i<=x;i++)
     {
        if (x%i==0)
            return false;
    }
    return true;
}
vector<pair<int,int>>primeFactors(int n)
{
    vector<pair<int,int>>v;
    int x=0;
    while (n % 2 == 0)
    {
        x++;
        n = n/2;
    }
    if(x>0)
    v.pb({2,x});
    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        int y=0;
        while (n % i == 0)
        {
            y++;
            n = n/i;
        }
        if(y>0)
        v.pb({i,y});
    }
    if (n > 2)
        v.pb({n,1});
    return v;
}
int maxSubArraySum(int a[], int size)
{
    int max_so_far = INT_MIN, max_ending_here = 0;

    for (int i = 0; i < size; i++)
    {
        max_ending_here = max_ending_here + a[i];
        if (max_so_far < max_ending_here)
            max_so_far = max_ending_here;

        if (max_ending_here < 0)
            max_ending_here = 0;
    }
    return max_so_far;
}

void solve()
{
int a,b;
cin>>a>>b;
cout<<a*b<<endl;
}
signed main()
{ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t;
//cin>>t;
t=1;
while(t--)
{

solve();

}
}


Measured memory_bytes: 3680
#include<iostream>
#include<unordered_map>
#include<sstream>
#include<string>
#include<algorithm>
using namespace std;

const int tablesize = 3000;

/*
class Data{
public:
  bool flag;
  //list<int> min;
  //list<int> mid;
  bool minflag[1000];
  bool midflag[1000];

};*/

//Data table[tablesize];

int main(){

    int n,p[3],count,psum;
    unordered_map<string,int> mp;
    const int defaultnum = mp["d"];
    int ok= (defaultnum == 10) ? 0 : 10;



    count = 0;

    cin >> n;

    for(int i=0;i<n;i++){
      cin >> p[0] >> p[1] >> p[2];
      sort(p,p+3);
      psum = p[0] + p[1] + p[2];
      string keystring="";
      stringstream ss;
      for(int j=0;j<3;j++){
        ss << p[j];
      }

      ss >> keystring;

      if(mp[keystring] == ok){
        count++;
      }
      else{
        mp[keystring] = ok;
      }


    /*  Data& tmp = table[psum];
      int pmin=p[0],pmid=p[1];
      if(!tmp.flag){
        tmp.flag = true;
        tmp.minflag[pmin] = true;
        tmp.midflag[pmid] = true;
        //tmp.min.push_back(pmin);
        //tmp.mid.push_back(pmid);
      }
      else{
        bool ok = false;

        if(tmp.minflag[pmin] && tmp.midflag[pmid]){
          count++;
        }
        else{
          tmp.minflag[pmin] = true;
          tmp.midflag[pmid] = true;
        }


        /*list<int>::iterator minit;
        list<int>::iterator midit;
        for(minit = tmp.min.begin(); minit != tmp.min.end(); minit++){
          if(*minit == pmin){
            ok = true;
            break;
          }
        }

        if(ok){

          ok = false;

          for(midit = tmp.mid.begin(); minit != tmp.mid.end(); midit++){
            if(*midit == pmid){
              ok = true;
              break;
            }
          }

          if(ok){
            count++;
            continue;
          }
        }

        tmp.min.push_back(pmin);
        tmp.mid.push_back(pmid);

      }*/

    }

    cout << count << endl;


    return 0;
}

Measured memory_bytes: 3320
#include <iostream>
#include<stdio.h>
using namespace std;
int main()
{
	char s[4];
	for (int i = 0; i < 3;i++)
	{
		scanf("%c",&s[i]);
	}
	int flag = 0;
	for (int i = 0; i < 2;i++)
	{
		if(s[i]!=s[i+1])
		{
				flag = 1;
				break;
		}
	}
	if(flag==0)
		printf("No\n");
	else
		printf("Yes\n");
}


Measured memory_bytes: 256
package main

import "fmt"

func pow2(n int) int {
	return n * n
}

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := range a {
		fmt.Scan(&a[i])
	}
	minDiff := 2000000
	for i := -100; i <= 100; i++ {
		diff := 0
		for j := range a {
			diff += pow2(a[j] - i)
		}
		if diff < minDiff {
			minDiff = diff
		}
	}
	fmt.Println(minDiff)
}


Measured memory_bytes: 512
/* C - Walking Takahashi */

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

int main(){
  long long X, K, D, p, m, ans;
  cin >> X >> K >> D;
  if(X >= 0){
    p = X % D;
    m = p - D;
    if(K >= (X - p) / D){
      K -= (X - p) / D;
      if(K % 2 == 0){
        ans = llabs(p);
      }else{
        ans = llabs(m);
      }
    }else{
      ans = llabs(X - K * D);
    }
  }else{
    m = X % D;
    p = m + D;
    if(K >= (m - X) / D){
      K -= (m - X) / D;
      if(K % 2 == 0){
        ans = llabs(m);
      }else{
        ans = llabs(p);
      }
    }else{
      ans = llabs(X + K * D);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3592
#include <iostream>
#include <cctype>
#include <string>
using namespace std;

int main() {
    string s;
    string ans;
    getline(cin, s); // cin >> stringでは空白区切りだがgetlineでは1行分読み込める
    int l = s.length(); // 文字列のバイト数を出す
    
    for (int i = 0; i < l; i++) {
        char x = s[i];
        
        if (islower(x)) {
            ans += toupper(x);
        } else if (isupper(x)) {
            ans += tolower(x);
        } else {
            ans += x;
        }
        
    }
    
    cout << ans << endl;
    
}




Measured memory_bytes: 3200
n, m = map(int, input().split())
a_lst = []
a_lst = list(map(int, input().split()))
# print()
percent = sum(a_lst) / (4 * m)
cnt = 0
for i in range(n):
    # print("a", a_lst[i])
    # 同値の場合を書いてなくて1WAあほまぬけ
    if a_lst[i] >= percent:
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060