akhauriyash/Code-Regression huggingface dataset:
#pragma region header
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() {
    int n,k;cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    rep(i, n-k) {
        if(a[i]<a[i+k]) cout <<"Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 4840
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

//ワーシャルフロイド法による最短経路探索
//O(n^3)かかるので最大でもn=200くらい
int result[205][205];
void warshall_floyd(vector<vector<pii>>& cost_map){
    int n = cost_map.size();
    REP(i, n)REP(j, n) result[i][j] = INF;
    REP(i, n) result[i][i] = 0;
    REP(i, n) for(auto&& cost : cost_map[i]) result[i][cost.first] = cost.second;
    REP(i, n)REP(j, n)REP(k, n) chmin(result[j][k], result[j][i] + result[i][k]);
}

int main(void)
{
    int N,M,R;
    cin >> N >> M >> R;
    vector<int> r(R);
    for (int i = 0; i < R; i++) {
        cin >> r[i];
        r[i]--;
    }
    SORT(r);
    vector<vector<pii>> cost_map(N);
    REP(i, M){
        int A,B,C;
        cin >> A >> B >> C;
        A--;B--;
        cost_map[A].emplace_back(B, C);
        cost_map[B].emplace_back(A, C);
    }

    warshall_floyd(cost_map);

    int ans = INF;
    do{
        int tmp_ans = 0;
        REP(i, R-1){
            tmp_ans += result[r[i]][r[i+1]];
        }
        chmin(ans, tmp_ans);
    }while(next_permutation(ALL(r)));

    pr(ans);
}

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

const int W = 20, H = 20;
char board[H][W];
int w, h;

int dfs(int x, int y){
	int dx[] = {0, -1, 1, 0}, dy[] = {-1, 0, 0, 1};
	int c = 1;
	board[y][x] = '#';
	for(int i = 0;i < 4;++i){
		int tx = x + dx[i], ty = y + dy[i];
		if(0 <= tx && 0 <= ty && tx < w && ty < h && board[ty][tx] == '.'){
			c += dfs(tx, ty);
		}
	}
	return c;
}

int main(){
	int sx, sy;
	while(cin >> w >> h, w){
		for(int i = 0;i < h;++i){
			for(int j = 0;j < w;++j){
				cin >> board[i][j];
				if(board[i][j] == '@'){
					sx = j;
					sy = i;
				}
			}
		}
		cout << dfs(sx, sy) << endl;
//		for(int i = 0;i < h;++i){
//			for(int j = 0;j < w;++j){
//				cout << board[i][j];
//			}
//			cout << endl;
//		}
	}
	return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

int main() {
    int N;
    string S;
    int cnt = 0;
    cin >> N >> S;
    for (int i = 0; i < N - 2; i++) {
        if (S.substr(i, 3) == "ABC") cnt++;
    }
    cout << cnt << endl;
    return (0);
}


Measured memory_bytes: 256
from collections import defaultdict
import math

def main():
    n = int(input())
    mod = 1000000007
    zeroes = 0
    quadrant1 = defaultdict(int)
    quadrant2 = defaultdict(int)

    for _ in range(n):
        a, b = map(int, input().split())
        if a == b == 0:
            zeroes += 1
            continue

        g = math.gcd(a, b)
        a, b = a//g, b//g 
        
        if b < 0:
            a, b = -a, -b
        
        if a <= 0:
            a, b = b, -a
            quadrant1[(a, b)] += 0
            quadrant2[(a, b)] += 1
        else:
            quadrant1[(a, b)] += 1
            quadrant2[(a, b)] += 0
    
    ans = 1
    for key, value in quadrant1.items():
        now = 1
        now += pow(2, value, mod) - 1
        now += pow(2, quadrant2[key], mod) - 1
        ans = (ans * now) % mod
    
    ans += (zeroes - 1)
    return ans % mod

if __name__ == '__main__':
    print (main())

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

public class Program
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var sList = new List<string>();
        for (var i = 0; i < n; i++)
        {
            sList.Add(Console.ReadLine());
        }

        var acCount = sList.Count(s => s == "AC");
        Console.WriteLine($"AC x {acCount}");

        var waCount = sList.Count(s => s == "WA");
        Console.WriteLine($"WA x {waCount}");

        var tleCount = sList.Count(s => s == "TLE");
        Console.WriteLine($"TLE x {tleCount}");

        var reCount = sList.Count(s => s == "RE");
        Console.WriteLine($"RE x {reCount}");
    }
}

Measured memory_bytes: 33200
/*A - Ferris Wheel*/
#include <bits/stdc++.h>
using namespace std;

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int edad;
	int precio;

	cin >> edad >> precio;

	if(edad <= 5)
		cout << "0";
	else if(edad <= 12)
		cout << precio/2;
	else
		cout << precio;

	return 0;
}

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

using namespace std;

int mod = 1e9 + 7;

int main() {
	int n, m; cin >> n >> m;
	vector<set<int> > g(n+1);
	for (int i = 0; i < m; ++i) {
		int a, b; cin >> a >> b;
		if (g[a].count(b)) continue;
		g[a].insert(b);
		g[b].insert(a);
	}
	int res = 0;
	vector<bool> visit(n+1);
	function<int(int)> dfs = [&] (int u) {
		if (visit[u]) return 0;
		visit[u] = true;
		int res = 1;
		for (int to : g[u]) {
			res += dfs(to);
		}
		return res;
	};
	for (int i = 1; i <=n; ++i) {
		if (!visit[i]) {
			res = max(res, dfs(i));
		}
	}
	cout << res;
} 

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

int n,m;
char a[100][100],b[100][100];

int main(){
	cin >> n >> m;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++) cin >> a[i][j];
	for (int i=1;i<=m;i++)
		for (int j=1;j<=m;j++) cin >> b[i][j];
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			int f=0;
			for (int h=1;h<=m;h++){
				for (int l=1;l<=m;l++)
					if (a[i+h-1][j+l-1]!=b[h][l]){
						f=1;
						break;
					}
				if (f==1) break;
			}
			if (f==0){
				cout << "Yes" << endl;
				return 0;
			}		
		}
	}
	cout << "No" << endl;
	return 0;
}

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

int main() {
  long long N;
  cin >> N;

  //int sum = 0;
 // for (int i = 1; i < N; i++) {
//	cout << i % (i + 1) << endl;
//	sum += i % (i + 1);
  //}

  long long smart_sum = (N - 1) * (N / 2) + ((N % 2 != 0) * (N - 1)) / 2;

  //cout << sum << endl;
  cout << smart_sum << endl;

  return 0;
}


Measured memory_bytes: 256
import collections

n = int(input())

# 75 = 3*5*5 or 3*25 or 5*15 or 75
seed_primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

d = collections.defaultdict(lambda: 0)

def bunkai(n):
    if n == 1:
        return 0
    else:
        for i in seed_primes:
            if n % i == 0:
                d[i] += 1
                return bunkai(n//i)


for i in range(1, n+1):
    bunkai(i)

tot = 0
s = 0
dd = collections.defaultdict(lambda: 0)
for v in d.values():
    if v >= 74:
        dd[74] += 1
        s += 1
    elif v >= 24:
        dd[24] += 1
        s += 1
    elif v >= 14:
        dd[14] += 1
        s += 1
    elif v >= 4:
        dd[4] += 1
        s += 1
    elif v >= 2:
        dd[2] += 1
        s += 1


#74
tot += dd[74]
#24*2
tot += (dd[74]+dd[24])*(s-1)
#14*4
tot += (dd[74]+dd[24]+dd[14])*(s-dd[2]-1)
#4*4*2
tot += int((dd[74]+dd[24]+dd[14]+dd[4])*(dd[74]+dd[24]+dd[14]+dd[4]-1)*(s-2)/2)

print(tot)

Measured memory_bytes: 3444
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <climits>
#include <iomanip>
#include <string.h>
#include <algorithm>

using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, a, b) for (int i = (int)(a); i >= b; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define clr(a,b) memset((a),b,sizeof(a))
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define sz(a) int((a).size())
#define pb push_back

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); }
template<typename T> T pow(T a,T b, ll m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }

const int N = 2e5+77;
const ll mod = 1e9+7;

int main(){
    fast;
    int n,a[N],vis[N]={0};
    cin>>n;
    for1(i,n) cin>>a[i];
    int cur = 1,ans=0;
    while(!vis[cur]){
        vis[cur]=1;
        if(cur==2){
            cout<<ans<<endl;
            return 0;
        }
        ans++;
        cur = a[cur];
    }
    cout<<"-1\n";
    return 0;
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n, k;
    string s;
    cin >> n >> k >> s;

    int cnt = 0, state = 0;
    char c = s.front(), d = (c == 'L' ? 'R' : 'L');

    REP(i, n){
        if(s[i] == d){
            s[i] = c;
            if(i < n-1 && s[i+1] == c){
                cnt++;
            }
        }
        if(cnt >= k) break;
    }

    int ans = 0, len = 0;
    REP(i, n-1){
        if(s[i] == s[i+1]){
            len++;
        }else{
            ans += len;
            len = 0;
        }
    }

    ans += len;

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


Measured memory_bytes: 512
#include<iostream>
using namespace std;
#define M 1000001
int main()
{
  bool p[M];
  int a,b;
  int i,j;
  for(i=1;++i*i<M;)for(j=i+i;!p[i]&j<M;j+=i)p[j]=1;
  while(cin>>a>>b,a|b){
    int f=1,key=0;
    for(i=a;i>=2;i--){
      if(p[i])continue;
      if(a%i)continue;
      key+=f*i;
      f=-1;
    }
    f=-1;
    for(i=b;i>=2;i--){
      if(p[i])continue;
      if(b%i)continue;
      key+=f*i;
      f=1;
    }
    puts(key>0?"a":"b");
  }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

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;}

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    string s; cin >> s;
    ll k = 0;
    vector<int> pow10(s.size()+1, 0);
    pow10[0] = 1;
    REP(i, 1, s.size()+1){
        pow10[i] = (pow10[i-1] * 10 % 2019);
    }
    reverse(ALL(s));
    int ans = 0, sum = 0;
    map<int, int> mp;
    mp[0]++;
    int num = 1;
    vector<int> lis(s.size());
    REP(i, 0, s.size()){lis[i] = s[i] - '0';}
    REP(i, 0, s.size()){
        sum = (sum + lis[i]*pow10[i])%2019;
        mp[sum]++;
    }
    for(auto &x: mp){
        ans += (x.second*(x.second-1)) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5184
/*
 *  author: chw0501
 *  reference: 
 *  created: 19.04.2020 04:21:43(UTC)
*/
#include <bits/stdc++.h>

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

#define MOD 1000000007
int n;
ll k;
struct M{
	ll v[50][50];
	M(){
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				v[i][j]=0;
	}
};
M init;
M mul(M&a,M&b){
	M ret;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			for(int k=0;k<n;k++){
				(ret.v)[i][j]=( (ret.v)[i][j]+(a.v)[i][k]*(b.v)[k][j] )%MOD;
			}
		}
	}
	return ret;
}

M solve(ll k){
	if(k==1) return init;
	M m=solve(k/2);
	M m_=mul(m,m);
	if(k%2==1) return mul(m_,init);
	else return m_;
}
int main(){
	cin>>n;
	cin>>k;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			int x;
			scanf("%d",&x);
			(init.v)[i][j]=x;
		}
	}
	M ans=solve(k);
	ll res=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			res=(res+(ans.v)[i][j])%MOD;
		}
	}
	cout<<res;
	return 0;
}

Measured memory_bytes: 2560
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
const int M=1e5+7;
char s[M],q[M];
int w[M];
int len,cnt,ans;
int main(){
	scanf("%s",s+1); len=strlen(s+1);
	for(int i=1;i<=len;i++)if(s[i]!='x') q[++cnt]=s[i],w[cnt]=i;
	int L=1,R=cnt;
	while(L<R){
		if(q[L]==q[R]) L++,R--;
		else return printf("-1\n"),0;
	}
	if(cnt%2==0) L=cnt/2,R=L+1;
	else L=R=cnt/2+1;
	int l=w[L],r=w[R];
	while(L>=1&&R<=cnt){
		L--; R++;
		int sum1=0,sum2=0;
		while(l>=1&&s[l]!=q[L]) l--,sum1++; l--;
		while(r<=len&&s[r]!=q[R]) r++,sum2++; r++;
		ans=ans+abs(sum1-sum2);
	}printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 768
import collections
N=int(input())
A=collections.Counter(list(map(int,input().split())))
if N%2==0:
  for i in range(0,N,2):
    if i%2==0 and A[i]==0:
      pass
    elif i%2==1 and A[i]==2:
      pass
    else:
        print(0);exit(0)
else:
  for i in range(N):
    if i==0 and A[i]==1:
      continue
    if i%2==0 and A[i]==2:
      pass
    elif i%2==1 and A[i]==0:
      pass
    else:
      print(0);exit(0)
print(pow(2,N//2,10**9+7 ))

Measured memory_bytes: 93420
function Main(input) {
  var lines = input.split('\n');

  var num = Math.floor(lines[0]);
  
  var array = lines[1].split(' ').map(str => parseInt(str, 10));
  
  var currentNum = 1;
  var hummered = [];
  var flag = true;
  
  for (var i = 0; i < array.length; i++) {
    if (array[i] !== currentNum) {
      hummered.push(array[i]);
    } else if (array[i] === currentNum) {
      currentNum++;
    }
  }
  
  if (hummered.length === num) {
    var j = 1;
    for (var i = 0; i < num; i++) {
      if (array[i] !== j) {
        flag = false;
      }
    }
    if (flag) {
      console.log('1');
    } else {
      console.log('-1');
    }
  } else {
    console.log(hummered.length);
  }
  
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 37208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}

int main() {
  int a,b;cin>>a>>b;
  int ans=0;
  if(a<=5){
    ans=0;
  }else if(a<=12){
    ans=b/2;
  }else{
    ans=b;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
L = []
T = {}
for i in range(N):
    T[i+1] = A[i]
newT = {v : k for k, v in T.items()}
for i in range(1,N+1):
    L.append(newT[i])
print(*L)

Measured memory_bytes: 76968
import java.util.*;
import static java.lang.Math.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int h = sc.nextInt();
        int w = sc.nextInt();
        int k = sc.nextInt();
        String[][] grid = new String[h][w];

        for (int i = 0; i < h; i++) {
            grid[i] = sc.next().split("");
        }

        // 全探索
        int ans = 0;
        for (int rows = 0; rows < 1 << h; rows++) {
            for (int cols = 0; cols < 1 << w; cols++) {
                int black = 0;
                for (int i = 0; i < h; i++) {
                    if ((1 & rows >> i) == 1) continue;
                    for (int j = 0; j < w; j++) {
                        if ((1 & cols >> j) == 1) continue;
                        if (grid[i][j].equals("#")) black++;
                    }
                }
                if (black == k) ans++;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 35796
#include<bits/stdc++.h>
const int N=1e5+9;
using namespace std;
int a[N],n,num,vis[N];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i) scanf("%d",&a[i]);
	for(int i=1;i<=n;++i)
	 vis[a[i]]++;
	
	num=vis[0]+vis[1];
	for(int i=1;i<=1e5+1;++i)
	 num=max(num,vis[i]+vis[i-1]+vis[i+1]);
	 
	cout<<num<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(){
	int i,n,ans=0;
	scanf("%d",&n);
	for (i=1;i<n;i++) ans+=(n-1)/i;/*n>1; if n%i==0 => c==0 but c>0, thats why n-1
    								c==(n-1)%i+1*/
	printf("%d\n",ans);
	return 0;
}


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

#define m 1000000007
using namespace std;

int main() 
{
    int h,w;
    cin>>h>>w;
    char a[h][w];
    for(int i=0;i<h;i++)
    {
        for(int j=0;j<w;j++)
        {
            cin>>a[i][j];
        }
    }
    int b[h][w];
    for(int i=0;i<h;i++)
    {
        for(int j=0;j<w;j++)
        {
            b[i][j]=0;
        }
    }
    b[0][0]=1;
    for(int i=1;i<h;i++)
    {
        if(a[i][0]=='#')
        {
            b[i][0]=0;
        }
        else
        {
            b[i][0]=b[i-1][0];
        }
    }
    for(int i=1;i<w;i++)
    {
        if(a[0][i]=='#')
        {
            b[0][i]=0;
        }
        else
        {
            b[0][i]=b[0][i-1];
        }
    }
    for(int i=1;i<h;i++)
    {
        for(int j=1;j<w;j++)
        {
            if(a[i][j]=='#')
            {
                b[i][j]=0;
            }
            else{
                b[i][j]=(b[i-1][j]%m + b[i][j-1]%m)%m;
            }
        }
    }
    cout<<(b[h-1][w-1])%m<<endl;
    return 0;
}


Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
// #ifndef ONLINE_JUDGE
//     freopen("input1.txt", "r", stdin);
//     freopen("output1.txt", "w", stdout);
// #endif


    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a,b;
    cin >> a >> b;
    cout << a*b <<"\n";


    return 0;

}

Measured memory_bytes: 3656
// 2020-08-25 23:21:21
// clang-format off
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

// clang-format on
void answer() {
  ll d, g;
  cin >> d >> g;
  vector<ll> p(d), c(d);
  rep(i, d) cin >> p[i] >> c[i];
  ll ans = 100000;
  rep(i, 1 << d) {
    ll rem = g, now = 0;
    rep(j, d) if ((i >> j) & 1) {
      rem -= p[j] * 100 * (j + 1) + c[j];
      now += p[j];
    }
    REPCM(j, d - 1, 0) {
      if (!((i >> j) & 1)) {
        rep(_, p[j]) {
          if (rem > 0) {
            now++;
            rem -= 100 * (j + 1);
          }
        }
      }
    }
    chmin(ans, now);
  }
  cout << ans << '\n';
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3624
#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 MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)

const int INF=1000;
char maze[51][51];
int dx[4]={1,0,0,-1};
int dy[4]={0,1,-1,0};
int sx=0,sy=0;
int d[51][51];

int main(){
  int h,w;
  cin >> h >> w;
  rep(i,h){
    rep(j,w){
      cin >> maze[i][j];
    }
  }
  int gx=h-1, gy=w-1;
  rep(i,h){
    rep(j,w){
      d[i][j]=INF;
    }
  }
  d[0][0]=0;
  
  queue<pint> que;
  pint p(0,0);
  que.push(p);
  
  while (!que.empty()){
    pint n = que.front();
    que.pop();
    
    rep(i,4){
      int nx = n.first + dx[i], ny = n.second + dy[i];
      if (nx >=0 && nx < h && ny >=0 && ny < w && maze[nx][ny]!='#' && d[nx][ny]==INF ){
        d[nx][ny]=d[n.first][n.second]+1;
        pint m(nx,ny);
        que.push(m);
      }
    }
  }
  
 // cout << d[gx][gy] << endl;
  
  int ans=0;
  int b=0;
  rep(i,h){
    rep(j,w){
      if (maze[i][j]=='#'){
        b++;
      }
    }
  }
  ans=h*w-(d[gx][gy]+1)-b;
  if (d[gx][gy]==INF) ans=-1;
  
  cout << ans << endl;
  

  
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
using namespace std;
const int maxn = 1e5+10;
char in[maxn], save[maxn];
int dis[maxn];
int main(){
    scanf("%s", in);
    int i;
    int p = -1, len = strlen(in);
    for(i=0;i<len;i++){
        if(in[i]!='x'){
            save[++p] = in[i];
        }
    }
    bool flag = true;
    int l,r;
    if(p%2){
        l = p/2, r = p/2+1;
    }else{
        l = p/2-1, r = p/2+1;
    }
    while(l>=0){
        if(save[l]!=save[r]){
            flag = false;
            break;
        }
        --l, ++r;
    }
    --len;
    if(len%2){
        l = len/2, r = len/2+1;
    }else{
        l = len/2-1, r = len/2+1;
    }
    p = -1;
    int now = 0;
    for(i=0;i<=len;i++){
        if(in[i]!='x'){
            dis[++p] = now;
            now = 0;
        }else{
            ++now;
        }
    }
    dis[++p] = now;
    int res = 0;
    if(p%2){
        l = p/2, r = p/2+1;
    }else{
        l = p/2-1, r = p/2+1;
    }
    while(l>=0){
        res += max(dis[l],dis[r]) - min(dis[l],dis[r]);
        --l, ++r;
    }
    if(!flag){
        printf("-1\n");
    }else{
        printf("%d\n",res);
    }
    
    
    
    
    return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};
constexpr int H_MAX = 20;

int h, w;
vector<vector<bool>> maze(H_MAX, vector<bool>(H_MAX, false));

bool check(Pii p) {
    return (0 <= p.first && p.first < h && 0 <= p.second && p.second < w && maze[p.first][p.second]);
}

int bfs(int si, int sj) {
    int ret = 0;
    queue<Pii> que;
    vector<vector<int>> dist(h, vector<int>(w, INF));
    que.emplace(si, sj);
    dist[si][sj] = 0;
    while(!que.empty()) {
        Pii p = que.front(); que.pop();

        for(int k=0;k<4;++k) {
            Pii q = {p.first+dyx[k][0], p.second+dyx[k][1]};
            if(check(q) && dist[q.first][q.second] == INF) {
                que.push(q);
                dist[q.first][q.second] = dist[p.first][p.second] + 1;
                ret = max(ret, dist[q.first][q.second]);
            }
        }
    }

    return ret;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    cin >> h >> w;
    string s;
    for(int i=0;i<h;++i) {
        cin >> s;
        for(int j=0;j<w;++j) {
            maze[i][j] = (s[j] == '.');
        }
    }

    int ans = 0;
    for(int si=0;si<h;++si) {
        for(int sj=0;sj<w;++sj) {
            if(maze[si][sj]) ans = max(ans, bfs(si, sj));
        }
    }

    cout << ans << endl;
}


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

int divnum(int n) {
    int num = 1;
    for (int i = 2; i*i <= n; ++i) {
        if (n % i != 0) continue;
        int tmp = 0;
        while (n % i == 0) n /= i, ++tmp;
        num *= tmp + 1;
    }
    if (n > 1) num *= 2;
    return num;
}

int main() {
    int n;
    cin >> n;
    int res = 0;
    for (int i = 1; i <= n; i += 2) {
        if (divnum(i) == 8) ++res;
    }
    cout << res << endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
 
public class Main{
    static long mod=1000000007;
//    static int dx[]={-1,0,1,0};
//    static int dy[]={0,-1,0,1};

    public static void main(String[] args)   throws Exception, IOException{        
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int x = sc.nextInt();
        int a = sc.nextInt();
           
        out.println(x<a ?0:10);
        out.flush();
    }

    static boolean validpos(int x,int y,int r, int c){
        return x<r && 0<=x && y<c && 0<=y;
    }

    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }
}
//class P {
//    int id, d;
//    P(int  id, int d) {
//        this.id=id;
//        this.d=d;
//    }
//}

//class P implements Comparable<P>{
//    int a,b;
//    double c;
//    P(int a, int b) {
//    	this.b=b;
//    	this.a=a;
//    	this.c=(double)b/a;
//    }
//
//    public int compareTo(P p){
//        return Double.compare(p.c,c);
//    }
//}

class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public int[] nextIntArray(int size) throws IOException{
        int r[] = new int[size];
        for (int i = 0; i < size; i++) {
            r[i] = this.nextInt(); 
        }
        return r;
    }
    public long[] nextLongArray(int size) throws IOException{
        long r[] = new long[size];
        for (int i = 0; i < size; i++) {
            r[i] = this.nextLong(); 
        }
        return r;
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}


Measured memory_bytes: 21076
#include <stdio.h>

int main(void){

  char S[100];
  scanf("%s",S);
  int i, count=0;
  for(i=0;S[i]!='\0';i++){
    count+=1;
  }
  int j;
  for(j=0;j<count;j++){
    printf("x");
  }

  return 0;
}


Measured memory_bytes: 128
//package Educ_DP;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int m=1000000007;
        Scanner s = new Scanner(System.in);
        String[] l = s.nextLine().split(" ");
        int row = Integer.parseInt(l[0]);
        int col = Integer.parseInt(l[1]);
        String[] list=new String[row];
        for (int i=0;i<row;i++){
            list[i]=s.nextLine();
        }
        long[][] dp=new long[row][col];
        if (list[0].charAt(0)=='.'){
            dp[0][0]=1;
        }
        for (int i=0;i<row;i++){
            for (int j=0;j<col;j++){
                if (i!=0 || j!=0){
                    if (list[i].charAt(j)=='#'){
                        dp[i][j]=0;
                    }
                    else{
                        if (j==0){
                            dp[i][j]=dp[i-1][j]%m;
                        }
                        else if (i==0){
                            dp[i][j]=dp[i][j-1]%m;
                        }
                        else{
                            dp[i][j]=(dp[i-1][j]+dp[i][j-1])%m;
                        }
                    }
                }
            }
        }
        System.out.println((((dp[row-1][col-1])%m)+m)%m);





    }
}


Measured memory_bytes: 53148
n,m=map(int,input().split())
a=[list(input())for i in range(n)]
b=[list(input()) for i in range(m)]

def judge(i,j):
    for k in range(m):
        for l in range(m):
            if b[k][l]!=a[i+k][j+l]:
                return False
    return True

for i in range(n-m+1):
    for j in range(n-m+1):
        if judge(i,j):
            print('Yes')
            exit()
print('No')

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
	string s;
	cin >> s;
	int maxrain = 0;
	int r = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'R') {
			r++;
			maxrain = max(maxrain, r);
		}
		else {
			r = 0;
		}
	}
	cout << maxrain << endl;
	return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>
int main()
{
    int n,k,i,j,s=0,temp;
    long long int sum=0;
    int ara[1001];
    scanf("%d %d",&n,&k);
    for(s=0;s<n;s++)
    {
        scanf("%d",&ara[s]);
    }
    for(i=1;i<n;i++)
    {
        for(j=n-1;j>=i;j--)
        {
            if(ara[j-1]>ara[j])
            {
                temp=ara[j-1];
                ara[j-1]=ara[j];
                ara[j]=temp;
            }
        }
    }
    for(s=0;s<k;s++)
    {
        sum=sum+ara[s];
    }
    printf("%lld",sum);
    return 0;
}


Measured memory_bytes: 1708
import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

main = do
  [a, b, k] <- map (read::String -> Int) . words <$> getLine
  forM [a..(min (a + k - 1) b)] (\x -> print x)
  forM [(max (b - k + 1) (a + k))..b] (\x -> print x)


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

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; }
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
using Graph = vector<vector<int>>;
queue<int> quex,quey;

int main(){
    long long a,b,c,d,k;    cin >> a ;
    for(int i=0;i<=10010;i++){
        b=a+i;
        //cout << i << endl;
        for(int j=2;j<=b;j++){
            //if(b%j!=0) continue;
            if(j==b) {cout << b << endl; return 0;}
            if(b%j==0) break;
             
        }

    }

    }


Measured memory_bytes: 256
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

/// 空白で区切られた複数の値の読み込む。
/// # Example
/// ```ignore
/// use cp_template::*;
///
/// let (a,b):(usize,usize);
/// input!(a,b);
/// ```
#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

/// 文字列を一行読み込む
/// # Example
/// ```ignore
/// use cp_template::*;
///
/// let s = input_line_str();
/// ```
#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

/// 一つの変数を出力する。
/// ```
/// use cp_template::*;
///
/// let a=100;
/// p(a);
/// //上と下は等価です。
/// println!("{}",a);
/// ```
#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

/// 指定した行数を読み込み、二次元配列に変換する。
/// # Examples
/// ```ignore
/// use cp_template::*;
///
/// //10行読み込む。
/// let v = input_vector2d::<usize>(10);
/// ```
#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

/// 一行読み込み、配列(Vec)に変換する。
/// # Examples
/// ```ignore
/// use cp_template::*;
///
/// let v=input_vector::<usize>();
/// ```
#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

/// String(str)を配列(Vec<char>)に変換する。
/// # Examples
/// ```ignore
/// use cp_template::*;
///
/// let s = String::from("abc");
/// let v = str2vec(&s);
/// let v = str2vec(&input_line_str());
/// ```
#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

}

use input::*;

fn main() {
    let n: usize;
    input!(n);
    let mut v = vec![2u64, 1u64];
    for z in 2..n+1 {
    	let a=v[z-2];
        let b=v[z-1];
        v.push(a + b);
    }
    p(v[n]);
}

Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

class Main {
    public static void main(String[] args) {
        String line = readLine(System.in);
        String[] input = line.split(" ");
        int a = Integer.parseInt(input[0]);
        int b = Integer.parseInt(input[1]);
        int c = Integer.parseInt(input[2]);

        String result = "No";
        if (a < b && b < c) {
            result = "Yes";
        }

        System.out.println(result);
    }

    private static String readLine(InputStream in) {
        String line = null;
        BufferedReader reader = null;

        try {
            reader = new BufferedReader(new InputStreamReader(in));
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        return line;
    }
}

Measured memory_bytes: 16896
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class Main
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         long K = Long.parseLong(st.nextToken());
         int[] arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken())-1;
         boolean[] seen = new boolean[N];
         int[] dist = new int[N];
         int head = 0;
         while(!seen[head])
         {
            seen[head] = true;
            dist[arr[head]] = dist[head]+1;
            head = arr[head];
         }
         if(K < dist[head])
         {
            Queue<Integer> q = new LinkedList<Integer>();
            q.add(0);
            while(q.size() > 0 && K > 0)
            {
               int curr = q.poll();
               int next = arr[curr];
               q.add(next);
               K--;
            }
            System.out.println(q.poll()+1);
         }
         else
         {
            K -= dist[head];
            ArrayList<Integer> path = new ArrayList<Integer>();
            path.add(head);
            int curr = arr[head];
            while(curr != head)
            {
               path.add(curr);
               curr = arr[curr];
            }
            K %= path.size();
            System.out.println(path.get((int)K)+1);
         }
      }
   }

Measured memory_bytes: 54484
// God put a smile upon your face <3

#include <bits/stdc++.h>`

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

#define mod 958585860497

#define base 2001487

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    long double b;
    long double a;

    while(cin >> a >> b)
    {
		ans = (a * b);

		printf("%lld\n", ans);
    }

}





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

#define MAXN 40010
#define X first
#define Y second

typedef long long ll;

int a[MAXN], c[MAXN];
int ans[110][110];


int main()
{
//	freopen("in.in", "r", stdin);
//	freopen("out.out", "w", stdout);
	
	int n, m, color, t = 0;
	scanf("%d %d %d", &n, &m, &color);
	for (int i = 1; i <= color; ++i)
	{
		scanf("%d", &a[i]);
		while (a[i]--) c[++t] = i;
	}
	t = 0;
	for (int i = 1; i <= n; ++i)
	{
		if (i & 1)
		{
			for (int j = 1; j <= m; ++j)
				ans[i][j] = c[++t];
		}
		else 
		{
			for (int j = m; j >= 1; --j)
				ans[i][j] = c[++t];
		}
		for (int j = 1; j <= m; ++j)
			printf("%d%c", ans[i][j], j == m? '\n':' ');
	}
	
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <string>
#include <sstream>

#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPP(i, a, b) for (int i = (a); i < (b); i++)

using namespace std;


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

    int N;
    char s;
    vector<int> cum_sum;
    int count=0;
    cin >> N;
    cum_sum.push_back(0);
    REP(i,N){
        cin >> s;
        if(s == 'W') count++;
        cum_sum.push_back(count);
     } 

     int m = N;
     REPP(i,1,N+1) m = min(m,(cum_sum[i-1]+(N-i-(cum_sum[N]-cum_sum[i]))));
     cout << m << endl;

    return 0;
}

Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ll unsigned long long
#define maxn 500005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int a, b;
    while (cin >> a >> b) {
        if (a > 9 || b > 9) {
            cout << "-1\n";
        }
        else {
            cout << a * b << '\n';
        }
    }
}


Measured memory_bytes: 256
ac = wa = tle = re = 0
for _ in range(int(input())):
	s = str(input())
	if s=='AC':
		ac+=1
	elif s=='WA':
		wa+=1
	elif s=='TLE':
		tle+=1
	else:
		re+=1
print('AC', 'x' , ac)
print('WA', 'x' , wa)
print('TLE', 'x' , tle)
print('RE', 'x' , re)

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



map< pair<int,int>, map<pair<int,int>,int> > es;

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

map< pair<int,int>,int> color;

int dfs(pair<int,int> p,int c){
	if( color.count(p) ){
		if( color[p] != c ) return 0;
		return 1;
	}else color[p] = c;
	for( auto e : es[p] ){
		if( !dfs(e.first,c^e.second) ){
			return 0;
		}
	}
	return 1;
}
int main(){
	int n;
	while(cin >> n && n){
		color.clear();
		es.clear();
		set< pair<int,int> > v;
		for(int i = 0 ; i < n ; i++){
			int x,y;
			cin >> x >> y;
			char c;
			cin >> c;
			for(int d = 0 ; d < 2 ; d++){
				for(int i = 0 ; i < 4 ; i++){
					int X = x + (c=='x' and d);
					int Y = y + (c=='y' and d);
					int XX = X + dx[i];
					int YY = Y + dy[i];
					if( v.count({XX,YY}) ){ 
						es[{X,Y}][{XX,YY}] = 0;
						es[{XX,YY}][{X,Y}] = 0;
					}
				}
			}
			v.insert({x,y});			
			if( c == 'x' ){
				v.insert({x+1,y});
				es[{x+1,y}][{x,y}] = 1;
				es[{x,y}][{x+1,y}] = 1;
			}else{
				v.insert({x,y+1});
				es[{x,y+1}][{x,y}] = 1;
				es[{x,y}][{x,y+1}] = 1;
			}

		}
		bool flag = true;
		for( auto i : v ){
			if( !color.count(i) ){
				flag &= dfs(i,0);
			}
		}
		cout << (flag?"Yes":"No") << endl;
		
	}
}

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

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    vector<ll> b(n);
    b[0]=a[0];
    for(int i = 1; i < n; i++) {
        b[i]=b[i-1]+a[i];
    }

    int idx=n;
    while(idx>0) {
        idx--;
        if(b[idx-1]*2<a[idx]) break;
    }
    cout << n-idx << "\n";
    return 0;
}

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

int main(){
    map <string, int> dic{};
    int n;
    int mx=0;
    cin >> n;
    rep(i,n){
        string a;
        int temp;
        cin >> a;
        temp = dic[a];
        temp++;
        dic.at(a)++;
        mx = max(temp,mx);
    }

    for(auto iter = dic.begin(); iter != dic.end(); iter++){
        if(iter->second == mx)cout << iter->first << endl;
    }
}

Measured memory_bytes: 25216
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    S = input().strip()

    dp = [0] * N
    for i, s in enumerate(S):
        if i == 0:
            continue
        before_ans = dp[i-1]
        now_S = S[:i+1]
        tmp_ans = now_S[-(before_ans+1):i+1]
        # print(i, before_ans, tmp_ans)
        if tmp_ans in now_S[:-(before_ans+1)]:
            dp[i] = before_ans + 1
        else:
            dp[i] = before_ans
    print(dp[-1])


if __name__ == "__main__":
    main()


Measured memory_bytes: 42140
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define bit(k) (1LL<<(k))
typedef long long ll;

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

const int INF = 1e9;
const ll INFLL = 1e18;
const ll MOD = 1e9+7;
const double PI = acos(-1.0);

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

/*------------------------------------/
for library*/

/*------------------------------------*/
ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b, a%b);
}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    ll a,b;
    cin>>a>>b;
    cout<<lcm(a,b)<<endl;
    
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    bool yes = false;
    if(a+b+c==17){
        if(a==5){
            if(b==5 || b==7){
                yes = true;
            }
        }
        else if(a==7){
            if(b==5){
                yes = true;
            }
        }
    }
    if(yes) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256