akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int n;
int a,b;
int t = 0;
char m[400][400];
int  s[400][400];
int main(){
    cin >> a >> b >> n;
    for(int i = 1; i <= a; i++) {
        for(int j = 1; j <= b; j++) {
            cin >> m[i][j];
            if(m[i][j] == '#'){
                t++;
                s[i][j] = t;
            }
        }
    }
    int f;
    int start = 0;
    for(int i = 1; i <= a; i++){
        for(int j = 1; j <= b; j++){
            if(s[i][j] != 0){
                f = j;
                for(int p = start; p <= f - 1; p++){
                    s[i][p] = s[i][j];
                }
                    start = f + 1;
            }
        }
        for(int o = start; o <= b; o++){
            s[i][o] = s[i][f];
        }
        start = 0;
    }
     
    int j;
    for(int i = 1; i <= a; i++){
        int sum = 0;
        for(j = 1; j <= b; j++){
            if(s[i][j] == 0){
                sum += 1;
            }
        }
        if(sum == b && i == 1){
            for(int j = 1; j <= b; j++){
                s[i][j] = s[i + 1][j];
            }
        }
        if(sum == b && i >= 2){
            for(int j = 1; j <= b; j++){
                s[i][j] = s[i - 1][j];
            }
        }
    }
    int x,y;
    int sum1;
    int flag = 0;
    for(x = 1; x <= a; x++){
        sum1 = 0;
        for(y = 1; y <= b; y++){
            if(s[x][y] == 0){
                sum1 += 1;
            }
        }
        if(sum1 < b && y == b + 1){
            break;
        }
    }
    for(int i = 1; i <= x - 1; i++){
        for(int j = 1; j <= b; j++){
            s[i][j] = s[x][j];
        }
    }

    for(int i = 1; i <= a; i++){
        for(int j = 1; j <= b; j++){
            cout << s[i][j] << ' ';
        }
        cout << endl;
    }
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  int s[N];
  int sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> s[i];
    sum += s[i];
  }
  sort(s, s + N);

  // 解答
  if (sum % 10 != 0) {
    cout << sum << endl;
  } else {
    bool flag = false;
    for (int i = 0; i < N; i++) {
      if (flag) continue;
      if (s[i] % 10 != 0) {
        cout << sum - s[i] << endl;
        flag = true;
      }
    }
    if (!flag) cout << 0 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	
	private static long sol = Long.MAX_VALUE;
	private static void check(long base, long n, long s) {
		long sum = 0;
		for (long x = n; x > 0; x /= base) 
			sum += x % base;
		if (sum == s) 
			sol = Math.min(sol, base);
	}
	
	private static long solve(long n, long s) {
		if (n < s) 
			return -1;
		if (n == s)
			return n + 1;
		long diff = n - s;
		for (long i = 1; i * i <= diff; ++i) {
			if (diff % i != 0) 
				continue;
			check(i + 1, n, s);
			check(diff / i + 1, n, s);
		}
		return (sol == Long.MAX_VALUE) ? -1 : sol;
	}
	
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		long n = sc.nextLong();
		long s = sc.nextLong();
		
		System.out.println(solve(n, s));
	}
}

Measured memory_bytes: 22996
N = gets.to_i
ac, wa,  tle, re = [0,0,0,0]
N.times do |n|
    s = gets.strip
    if s == "AC"
        ac+=1
    elsif s == "WA"
        wa+=1
    elsif s == "TLE"
        tle+=1
    elsif s=="RE"
        re+=1
    end
end
puts "AC x #{ac}\nWA x #{wa}\nTLE x #{tle}\nRE x #{re}"

Measured memory_bytes: 14372
import java.util.Collections;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.ArrayList;

public class Main {
    public static Scanner sc;
    public static TreeMap<String, ArrayList<Integer>> map;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        map = new TreeMap<>();
        
        while (sc.hasNext()) {
            String s = sc.next();
            int n = sc.nextInt();
            
            if (!map.containsKey(s)) {
                ArrayList<Integer> ary = new ArrayList<>();
                ary.add(n);
                map.put(s, ary);
            } else {
                map.get(s).add(n);
            }
        }
        
        for (String key: map.keySet()) {
            StringBuilder sb = new StringBuilder();
            ArrayList<Integer> list = map.get(key);
            Collections.sort(list);
            System.out.println(key);
            for (Integer i: list) {
                sb.append(i).append(" ");
            }
            sb.deleteCharAt(sb.length()-1);
            System.out.println(sb.toString());
        }
    }
}

Measured memory_bytes: 26284
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
int main(){
	//mahakal(),fast;
	
	ll n ;
	cin>> n ;
	ll arr[n+1]={0};
	for(ll i=0,a;i<n-1 ;i++){
		cin>>  a ;
		arr[a]++;
	}
	for(ll i=1;i<=n ;i++)cout<<arr[i]<<endl;

	return 0;
}

Measured memory_bytes: 5140
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::fixed<<std::setprecision(15);}}fIO;
/*-*/
#include <chrono>
struct timer
{
	std::chrono::time_point<std::chrono::steady_clock> start;
	timer() : start(std::chrono::steady_clock::now()) {}
	void ms() {
		std::chrono::duration<double> diff=std::chrono::steady_clock::now()-start;
		std::cerr << diff.count()*1000 << "ms\n";
	}
};
struct time_scope
{
	std::chrono::time_point<std::chrono::steady_clock> start;
	time_scope() : start(std::chrono::steady_clock::now()) {}
	~time_scope() {
		std::chrono::duration<double> diff=std::chrono::steady_clock::now()-start;
		std::cerr << diff.count()*1000 << "ms\n";
	}
};

template <typename T>
std::vector<int> sort_indexes(const std::vector<T> &v) {
	std::vector<int> idx(v.size());
	std::iota(idx.begin(), idx.end(), 0);
	std::sort(idx.begin(), idx.end(), [&v](int i1, int i2) {return v[i1] < v[i2];});
	return idx;
}


int main() {
	time_scope timer;
	int d;
	std::cin >> d;
	int N=26;
	std::vector<lnt> c(N);
	std::vector<std::vector<lnt> > v(d,std::vector<lnt>(N));
	rep(i,N) std::cin >> c[i];
	rep(i,d) {
		rep(j,N) {
			std::cin >> v[i][j];
		}
	}
	lnt best=-10000000;
	std::vector<int> besta;
	for(int x=0;x<5;x++) {
		for(int y=1;y<25;y++) {
			for(int z=1;z<7;z++) {
				std::vector<int> ans; ans.reserve(d);
				std::vector<int> last(N,-1);
				rep(i,d) {
					std::vector<int> idx(N);
					std::iota(idx.begin(), idx.end(), 0);
					lnt X=x; lnt Y=y; lnt Z=z;
					auto f = [&](int ix) -> lnt {
						return c[ix]*(i-last[ix]+X)*Y+v[i][ix]*Z;
					};
					std::sort(idx.begin(), idx.end(), [&](int i1, int i2) {return f(i1) > f(i2) ;});
					last[idx[0]]=i;
					ans.emplace_back(idx[0]);
					//print(idx[0]+1);
				}
				{
					lnt sum=0;
					std::vector<int> last(N,-1);
					rep(i,d) {
						int t=ans[i];
						sum+=v[i][t];
						last[t]=i;
						rep(j,N) sum-=(i-last[j])*c[j];
					}
					if(sum>best) {
						besta=ans;
						best=sum;
					}
				}
			}
		}
	}
	rep(i,d) {
		print(besta[i]+1);
	}
}


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

int main()
{
    int N;
    string S;
    cin >> N;
    cin >> S;
    int ans = 0;
    for (int i = 1; i <= N - 1; i++)
    {
        string left = S.substr(0, i);
        string right = S.substr(i, N - i);
        int count = 0;
        for (int j = 0; j < 26; j++)
        {
            if (left.find('a' + j) != string::npos && right.find('a' + j) != string::npos)
            {
                count++;
            }
        }
        ans = max(ans, count);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(void){
  int x, y, s;
  int i,j;
  int n=0;
  int price[999]={0};
 
  while(1){

    scanf("%d %d %d", &x, &y, &s);                      //変更前の消費税率 変更後の消費税率 合計価格の入力

    if((x==0 && y==0 && s==0) || x>=100 || y>=100 || x==y || s>=1000 || s<=10)
      break;                                            //全ての入力が0もしくは不適切な値が入力されたらループ終了

    for(i=1;i<s;i++){
      for(j=1;j<s;j++){
	if(s==i*(100+x)/100+j*(100+x)/100){             //変更前の消費税率で合計価格になれる組み合わせを探す
	  if(price[n]<i*(100+y)/100+j*(100+y)/100){
	    price[n]=i*(100+y)/100+j*(100+y)/100;       //変更後の消費税率でより大きい合計価格が出たらpriceを更新
	  }
	}
      }
    }
    n++;
  }
 
  for(i=0;i<n;i++){
    printf("%d\n", price[i]);                           //出力
  }

  return 0;
}

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	while(true){
		string s;
		cin >> s;
		if(s == "#"){ break; }
		vector<int> dirs;
		for(int i = 0; i < s.size(); i += (s[i] == 'n' ? 5 : 4)){
			dirs.push_back(s[i] == 'n');
		}
		const int n = dirs.size();
		int nume = 0, deno = 1;
		if(dirs[n - 1] == 0){ nume = 90; }
		for(int i = n - 2; i >= 0; --i){
			nume <<= 1; deno <<= 1;
			if(dirs[i]){
				nume -= 90;
			}else{
				nume += 90;
			}
		}
		const int g = __gcd(nume, deno);
		nume /= g; deno /= g;
		if(deno == 1){
			cout << nume << endl;
		}else{
			cout << nume << "/" << deno << endl;
		}
	}
	return 0;
}

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

using namespace std;

typedef vector<int> vec;

long long cnt=0;

void Merge_Sort(vec& A)
{
	int n=A.size();
	if(n==1) return;
	vec A1,A2;
	for(int i=0;i<n;i++)
		if(i<(n>>1))
			A1.push_back(A[i]);
		else
			A2.push_back(A[i]);
	Merge_Sort(A1);Merge_Sort(A2);
	int t=0,t1=0,t2=0,n1=A1.size(),n2=A2.size();
	while(t1<n1&&t2<n2)
	{
		if(A1[t1]<A2[t2])
			A[t++]=A1[t1++];
		else
		{
			A[t++]=A2[t2++];
			cnt+=n1-t1;
		}
	}
	while(t1<n1) A[t++]=A1[t1++];
	while(t2<n2) A[t++]=A2[t2++];
}

int main()
{
	int n;
	vec A;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		int t;
		scanf("%d",&t);
		A.push_back(t);
	}
	Merge_Sort(A);
	printf("%lld\n",cnt);
	return 0;
}

Measured memory_bytes: 5480
#include <iostream>
#include <string>
using namespace std;
int main(){
  string s;
  cin >> s;
  int last=s.size()-1;
  int cnt=0;
  int mid=0;
  if (s.size()%2) mid=s.size()/2+1;
  else mid=s.size()/2;
  for (int i=0; i < mid ; i++){
    if (s.at(i)!=s.at(last)) cnt++;
    last--;
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdio>

#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>

#include<algorithm>
#include<cmath>
#include<numeric>

using namespace std;
typedef long long ll;
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;}
const ll INF = 1e18+1;

/*
あみだくじは隣り合った二元の置換に該当する
1~Wに二元の置換のセットを合計H回行ってK番目に1を置くような組み合わせ

dp[i][j] = i回行ってj番目に1を置くような組み合わせ数

dp[i+1][j] = dp[i][j-1] * f(j-2) * f(j+1) + 
             dp[i][j] * f(j-1) * f(j+1) + 
             dp[i][j+1] * f(j-1) * f(j+2)
*/

ll dp[110][10];
ll memo[20];

ll f(ll n) {
    if (n <= 0) return 1;
    if (memo[n] != 0) return memo[n];
    if (n == 1) return 2;
    if (n == 2) return 3;
    ll res = f(n-1) + f(n-2);
    memo[n] = res;
    return res;
}

int main() {
    ll H, W, K;
    cin >> H >> W >> K;
    ll D = 1e9 + 7;
    dp[0][0] = 1;

    for (ll i = 0; i < H; i++) {
        for (ll j = 0; j < W; j++) {
            dp[i+1][j] = dp[i][j] * f(j -1) * f(W-j-1 -1) % D;
            if (j > 0) {
                dp[i+1][j] += dp[i][j-1] * f(j-1 -1) * f(W-j-1 -1) % D;
            }
            if (j < W-1) {
                dp[i+1][j] += dp[i][j+1] * f(j -1) * f(W-j-2 -1) % D;
            }
            dp[i+1][j] %= D;
        }
    }
    cout << dp[H][K-1] << endl;
}

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

int main()
{
    int odd = 0,n,ans=0;
    cin >> n;
    rep(i,n){
        int s;
        cin >> s;
        if(s%2)
            odd++;
    }
    odd %= 2;

    if(odd==1)
        cout << "NO" << endl;
    else
        cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)

int main()
{
    int n;
    cin >> n;
    int p[n];
    F(i,0,n) cin >> p[i];
    int cnt=0;
    F(i,1,n-1){
        if(p[i-1]<p[i] && p[i]<p[i+1] || p[i-1]>p[i] && p[i]>p[i+1]){
            ++cnt;
        }
    }
    cout << cnt  << endl;
    return 0;
}

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

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

if(N != 100){
    if(D == 0) cout << N << endl;
    else if (D == 1) cout << N * 100 << endl;
    else cout << N * 10000 << endl;
}
else{
    if(D == 0) cout << 101 << endl;
    else if (D == 1) cout << 10100 << endl;
    else cout << 1010000 << endl;    
}
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int n;
inline int read()
{
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0' &&ch<='9')s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
	return s*w;
}
int main()
{
	n=read();
	int ans;
	ans=n%10;
	if(ans==2 || ans==4 || ans==5 || ans==7 || ans==9)puts("hon");
	else if(ans==0 || ans==1 || ans==6 || ans==8)puts("pon");
	else puts("bon");
	return 0;
}

Measured memory_bytes: 3636
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", input => {
  const inputArr = input.split("\n");
  const K = inputArr[0];
  const S = inputArr[1];
  const result = getResult(K, S);
  console.log(result);
});

const getResult = (K, S) => {
  if (S.length <= K) {
    return S;
  }
  return S.slice(0, K) +  '...';
};


Measured memory_bytes: 30528
#!/usr/bin/env python3
n, *b = map(int, open(0).read().split())
ans = []
for i in reversed(range(n)):
    for j in reversed(range(i + 1)):
        if b[j] == j + 1:
            ans.append(b.pop(j))
            break
    else:
        print(-1)
        exit()
print(*reversed(ans), sep="\n")


Measured memory_bytes: 9108
<?php
list($a,$b,$c) = explode(" ",trim(fgets(STDIN)));

if($a == $b){
 if($a == $c){
  echo 1 . PHP_EOL;
 }else{
  echo 2 . PHP_EOL;
 }
}else{
 if($a == $c){
  echo 2 . PHP_EOL;
 }elseif($b == $c){
  echo 2 . PHP_EOL;
 }else{
  echo 3 . PHP_EOL;
 }
}
?>

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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    string x; cin >> x;

    stack<char> sta;

    int sum = 0;

    for (int i = 0; i < x.size(); ++i) {
        if (sta.empty()) {
            sta.push(x[i]);
        } else {
            if (x[i] == 'S') {
                sta.push(x[i]);
            } else {
                char t = sta.top();
                if (t == 'S') {
                    sta.pop();
                    ++sum;
                } else {
                    sta.push(x[i]);
                }
            }
        }
    }

    cout << x.size() - sum * 2 << endl;
}

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

using namespace std;
using ll = long long;


int main()
{
    int r;
    cin >> r;
    if(r >= 2800)cout << "AGC" << endl;
    else if(r >= 1200)cout << "ARC" << endl;
    else cout << "ABC" << endl;
}

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

using namespace std;
typedef long long int lli;
typedef vector<int> iv;
typedef vector<bool> bv;
typedef vector<string> sv;
typedef vector<long long int> llv;
typedef vector<double> dv;
#define debug_ printf("OK\n")

#define sor_(vec) sort(vec.begin(),vec.end())
#define rev_(vec) reverse(vec.begin(),vec.end())
#define rep(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define reps(i,n,s) for(int i=static_cast<int>(s);i<static_cast<int>(n);i++)
#define isposi(num) if(num>0)
const long long mod = 1000000007;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    double L;
    std::cin>>L;
    std::cout<<std::fixed<<std::pow(L/3,3);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int, int>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define FILLINF(a) memset(a, 0x3f, sizeof(a))
#define POW(n) (1LL << (n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i, a, b) ((a) <= (i) && (i) <= (b))
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a > b) { a = b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a < b) { a = b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(begin(a), end(a)); }
template <typename T> inline void REV(T& a) { reverse(begin(a), end(a)); }
template <typename T> inline void UNI(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <typename S, typename T> inline T LB(S& v, T a) { return *lower_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int LBP(S& v, T a) { return lower_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> inline T UB(S& v, T a) { return *upper_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int UBP(S& v, T a) { return upper_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> ostream& operator << (ostream& os, const pair<S, T>& p) { os << p.first << " " << p.second; return os; }
template <typename S, typename T> istream& operator >> (istream& is, pair<S, T>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator >> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for(auto &e : t) fill_v(e, v); }
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const lint MOD = 1000000007;

char C;

void _main() {
    cin >> C;
    cout << char(C + 1) << endl;
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("output.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String str = br.readLine();
        double r = Double.parseDouble(str);

        double a = r * r * Math.PI;
        double c = 2 * r * Math.PI;

        System.out.println(String.format("%.6f %.6f", a, c));
	}
}

Measured memory_bytes: 24792
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  int a, b; cin >> a >> b;
  if (a<=8 && b<=8) COUT("Yay!");
  else COUT(":(");
  return 0;
}


Measured memory_bytes: 256
ans=0
n=int(input())
comments={}
for i in range(n):
    num=int(input())
    comment=[]
    for j in range(num):
        comment.append(list(map(int,input().split(" "))))
    comments[i]=comment

for i in range(2**n):
    evidences={}
    people=list(str(format(i,'b').zfill(n)))
    conflict=False
    for idx,person in enumerate(people):
        if person=='1':
            for comment in comments[idx]:
                evidences.setdefault(comment[0],[]).append(comment[1])
    for key,value in evidences.items():
        personality = int(people[key-1])
        if value.count(personality) != len(value):
            conflict=True
            break
    if not conflict:
        ans=people.count('1')
print(ans)


Measured memory_bytes: 49244
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
int main()
{
  string s;
  cin >> s;
  int n = s.size()-1;
  ll ans = 0;
  
  for (int bit = 0; bit < (1 << n); bit++) {
    ll v = s.at(0) - '0';
    for (int i = 0; i < n; i++) {
      if (bit & (1 << i)) {
        ans += v;
        v = s.at(i+1) - '0';
      }
      else {
        v *= 10;
        v += s.at(i+1) - '0';
      }
    }
    ans += v;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
//
// Created by kuroneko on 2019-07-06.
//

using namespace std;

#include <iostream>
#include <vector>
#include <cmath>
#include <string>

typedef long long ll;
int INF = 1000000007;

int main() {
    int N, M; cin >> N >> M;
    int s[M], p[M];
    int ans = 0;
    for (int i = 0; i < M; i++) s[i] = 0;
    for (int i = 0; i < M; i++) {
        int k; cin >> k;
        for (int j = 0; j < k; j++) {
            int s_j; cin >> s_j;
            s_j--;
            s[i] |= (1<<s_j);
        }
    }
    for (int i = 0; i < M; i++) cin >> p[i];

    for (int bit = 0; bit < (1<<N); bit++) {
        int tmp[M];
        for (int i = 0; i < M; i++) tmp[i] = 0;
        for (int j = 0; j < N; j++) {
            if (bit & (1<<j)) {
                for (int i = 0; i < M; i++) {
                    if (s[i] & (1<<j)) tmp[i] += 1;
                }
            }
        }

        bool flag = true;
        for (int i = 0; i < M; i++) {
            if (tmp[i] % 2 != p[i]) flag = false;
        }

        if (flag) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

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

	string s;
	while(getline(cin, s))
	{
		int count = 0;
		for (int i = 0;i <= 127;i++)    
			if (s.find(i) != string::npos)
				count++;
		if (count != 2) {
			cout << "No" << '\n';
			continue;
		}

		int k = 0;
		for (int i = 0;i < 4;i++)
		{
			if (s[0] == s[i])	k++;
		}
		if (k == 2)
			cout << "Yes\n";
		else
			cout << "No\n";
	}
	
	

	return 0;
}


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

int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		cout<<(char)((((s[i]-'A')+n)%26)+65);
	}
	return 0;
}


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

int main() {
  string S, T;
  cin >> S;
  cin >> T;
  for(int i = 0; i < S.size(); i++ ) {
    S = S.back() + S;
    S.pop_back();
    if(S == T) {
      cout << "Yes" << endl;
      return 0;
    }
  }

  cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)


using namespace std;
using ll = long long;

int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int n,x,y;
    cin >> n>> x >> y;
    x--;
    y--;
    int ans[n-1];
    rep(i,n-1)ans[i]=0;
    for(int i=0;i<=n-2;++i)
    {
        for(int j=i+1;j<n;j++)
        {
            int dist;
            dist = min(max(x-i,i-x)+max(j-y,y-j)+1,j-i);
            ans[dist-1]++;
        }
        

    }
    rep(i,n-1)
    {
        cout << ans[i] << endl;
    
    }

    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <fstream>
#include <set>
#include <utility>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <numeric>
#include <sstream>
#include <list>
#include <map>
#include <stdlib.h>
#include <time.h>

#define rep(i,p,n) for(int i=(int)p;i<(int)n;i++)
#define repp(i,p,n) for(int i=(int)p;i>=(int)n;i--)
#define Sort(x) sort(x.begin(),x.end());
#define ll long long
#define INF 2000000000

using namespace std;

int main() {
	int n, k,ans=1,count=0;
	cin >> n >> k;
	while (n != 0) {
		n--;
		ans = (ans + k > ans * 2) ? ans * 2 : ans + k;
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
#include<ctype.h>

int main(){
  int r,d,xs;
  int i;
  int x[10];
  int tmp;

  scanf("%d%d%d",&r,&d,&xs);
  tmp=xs;
  for(i=0;i<10;i++){
    x[i]=(tmp*r)-d;
    tmp=x[i];
  }

  for(i=0;i<10;i++){
    printf("%d\n",x[i]);
  }

  return 0;
}


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

char str[100005];

int main(int argc, char* argv[])
{
    scanf("%s", str);

    long len=strlen(str);
    if(len<2) {
        printf("-1 -1\n");
        return 0;
    }
    long i;
    for(i=0; i<len-1; i++) {
        if(str[i]==str[i+1]) {
            printf("%ld %ld\n", i+1, i+2); return 0;
        }
        if(i<len-2 && str[i]==str[i+2]) {
            printf("%ld %ld\n", i+1, i+3); return 0;
        }
    }
    printf("-1 -1\n");

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

const inf = -1

var H, W, K int
var c []string
var d [][]int

type pair struct {
	x, y int
}

func bfs(sx, sy int) {
	q := make([]pair, 0)
	d[sx][sy] = 0
	q = append(q, pair{sx, sy})
	dx := []int{1, 0, 0, -1}
	dy := []int{0, 1, -1, 0}
	for len(q) != 0 {
		px, py := q[0].x, q[0].y
		q = q[1:]
		for j := 0; j < 4; j++ {
			cx := px
			cy := py
			for k := 0; k < K; k++ {
				cx += dx[j]
				cy += dy[j]
				if cx < 0 || cx >= H || cy < 0 || cy >= W {
					break
				}
				if d[cx][cy] != inf && d[cx][cy] <= d[px][py] {
					break
				}
				if d[cx][cy] != inf {
					continue
				}
				if c[cx][cy] == '@' {
					break
				}
				d[cx][cy] = d[px][py] + 1
				q = append(q, pair{cx, cy})
			}
		}
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1100000)
	H, W, K = getInt(), getInt(), getInt()
	sx, sy, ex, ey := getInt()-1, getInt()-1,
		getInt()-1, getInt()-1

	c = make([]string, H)
	for i := 0; i < H; i++ {
		c[i] = getString()
	}
	d = make([][]int, H)
	for i := 0; i < H; i++ {
		d[i] = make([]int, W)
		for j := 0; j < W; j++ {
			d[i][j] = inf
		}
	}
	bfs(sx, sy)
	out(d[ex][ey])
}


Measured memory_bytes: 45764
#include<bits/stdc++.h>
using namespace std;
int main(){
    long n;
    cin >> n;
    long a[n];
    for(int i=0;i<n;i++)cin >> a[i];
    long allXor = 0;
    for(int i=0;i<n;i++){
        allXor = allXor ^ a[i];
    }
    long ans[n];
    for(int i=0;i<n;i++){
        ans[i] = allXor ^ a[i];
    }
    for(int i=0;i<n;i++)cout << ans[i] << " ";
    cout << endl;
}

Measured memory_bytes: 6688
from sys import maxsize
from functools import reduce

WHITE = 0
GRAY = 1
BLACK = 2


def read_adj_mat():
    n = int(input())
    M = []
    for _ in range(n):
        M.append([maxsize if x == "-1" else int(x)
                  for x
                  in input().split()])
    return n, M


def min_sp_tree(n, M):
    d = [maxsize] * n
    p = [-1] * n
    color = [WHITE] * n

    d[0] = 0

    while True:
        minv = maxsize
        u = -1

        for i in range(n):
            if minv > d[i] and color[i] != BLACK:
                u = i
                minv = d[i]

        if u == -1:
            break

        color[u] = BLACK
        for v in range(n):
            if color[v] != BLACK and M[u][v] != maxsize:
                if d[v] > M[u][v]:
                    d[v] = M[u][v]
                    p[v] = u
                    color[v] = GRAY

    return sum([M[i][p[i]] for i in range(n) if p[i] != -1])


def main():
    n, M = read_adj_mat()
    print(min_sp_tree(n, M))


if __name__ == '__main__':
    main()



Measured memory_bytes: 6396
#include<iostream>
using namespace std;
main()
{
    int a,b,c,d,e;
    cin>>a>>b>>c;
   if(a==b+c)
   {
       cout<<"Yes"<<endl;
   }
   else if(b==a+c)
   {
       cout<<"Yes"<<endl;
   }
   else if(c==a+b)
   {
       cout<<"Yes"<<endl;
   }
   else
   {
    cout<<"No"<<endl;
   }
}


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

int main() {
    int n, k, m;
    while(cin >> n >> k >> m, n) {
        vector<int> v(n);
        iota(v.begin(), v.end(), 1);
        v.erase(v.begin() + m - 1);
        int pos = m-1;
        while(v.size() != 1) {
            pos = (pos + k - 1) % v.size();
            v.erase(v.begin() + pos);
        }
        cout << v[0] << endl;
    }
}


Measured memory_bytes: 3116
class DirectedGraph:
    def __init__(self, adj):
        self.n = len(adj)
        self.adj = adj
        self.is_asyclic = False
        self.max_path_len = None

    def topological_sort(self):
        indegree = [0] * self.n
        for i, vs in enumerate(self.adj):
            for dest in vs:
                indegree[dest] += 1
        zero_v = []
        for v, indeg in enumerate(indegree):
            if indeg == 0:
                zero_v.append(v)
        max_path_len = 1
        tp_sorted = []
        to_be_added = []
        while True:
            while zero_v:
                v = zero_v.pop()
                tp_sorted.append(v)
                for dest in self.adj[v]:
                    indegree[dest] -= 1
                    if indegree[dest] == 0:
                        to_be_added.append(dest)
            if len(to_be_added) > 0:
                zero_v += to_be_added
                to_be_added = []
                max_path_len += 1
            else:
                break
        if len(tp_sorted) == self.n:
            self.is_asyclic = True
            self.max_path_len = max_path_len
            return tp_sorted
        else:
            self.is_asyclic = False
            return None

if __name__ == "__main__":
    n = int(input())
    dic = {}
    itr = 0
    for i in range(n):
        for j in range(i+1, n):
            dic[i*n + j] = itr
            itr += 1
    edge = [[] for _ in range(n * (n-1) // 2)]
    for i in range(n):
        a = [int(item) - 1 for item in input().split()]
        for j1, j2 in zip(a, a[1:]):
            if i < j1:
                u = i * n + j1 
            else:
                u = j1 * n + i 
            if i < j2:
                v = i * n + j2 
            else:
                v = j2 * n + i 
            edge[dic[u]].append(dic[v])

    DG = DirectedGraph(edge)
    tps = DG.topological_sort()

    if DG.is_asyclic:
        print(DG.max_path_len)
    else:
        print(-1)

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

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if(b == 100)
    {
        cout << 101;
        if(a == 1)
            cout << "00";
        if(a == 2)
            cout << "0000";
        return 0;
    }
    cout << b;
    if(a == 1)
        cout << "00";
    if(a == 2)
        cout << "0000";
}


Measured memory_bytes: 256
A, B, C, X = [int(input()) for _ in range(4)]

# max_a = min(X//500, A)
# c = 0

# for a in range(0, max_a+1):
#     rest1 = X - 500 * a
#     max_b = min(rest1//100, B)
#     for b in range(0, max_b+1):
#         rest2 = rest1 - 100 * b
#         if rest2//50 <= C:
#             c += 1
# print(c)
count=0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 500*a + 100*b + 50*c == X:
                count+=1
print(count)

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




int main(void){
int n,s[1005];
double ave;

for(;;){
    int sum=0;
    double sum2=0.0;
    scanf("%d",&n);
    if(n==0){break;}
    for(int count=0;count<n;count++){
        scanf("%d",&s[count]);
        sum=sum+s[count];
    }
    ave=(double)sum/n;
   //printf("%lf\n",ave);
    for(int count=0;count<n;count++){
        sum2=sum2+((double)s[count]-ave)*(s[count]-ave);
    }
    //printf("%lf\n",sum2);
    sum2=sum2/(double)n;
    printf("%lf\n",sqrt(sum2));


}
}




Measured memory_bytes: 2064
#include<stdio.h>
int main() {
    int n, m, x, t1=0,t2=0,a;
    scanf("%d%d%d", &n, &m, &x);
    int i;
    for (i = 0; i < m; i++) {
        scanf("%d", &a);
        if (a < x)
            t1++;
        else
            t2++;
    }
    int ans = t1;
    if (t2 < ans)
        ans = t2;
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
s = str(input())
no = 0
while 1:
    for data in ["erase", "eraser", "dream", "dreamer"]:
        if s.endswith(data):
            s = s[: - len(data)]
        else:
            no += 1
    if not s:
        print("YES")
        exit()
    if no == 4:
        print("NO")
        exit()
    else:
        no = 0


Measured memory_bytes: 9056
from collections import Counter
a=[list(map(int, input().split())) for i in range(3)]
b=a[0]+a[1]+a[2]
b=Counter(b)
d=[2,2,1,1]
for i,j in b.most_common():
    if j in d:
        d.remove(j)
if d:print('NO')
else:print('YES')

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

#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define ACC(c) (accumulate(ALL(c), 0LL))
#define PRINT(x) cout << (x) << "\n"

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

inline int std_in(int& a) {return scanf("%d", &a);}
auto pint_compare = [](pint x, pint y) -> bool{return (x.first < y.first);};
const int MOD = 1000000007;


signed main(){
    int N;
    cin >> N;
    while(N % 111 != 0) N++;
    PRINT(N);
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  auto LR = vector<pair<int, int> >(N);

  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    auto p = make_pair(l, r);
    LR[i] = p;
  }

  int ans = 0;
  REP(i, N) {
    int l = LR[i].first;
    int r = LR[i].second;
    ans += r - l + 1;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <map>
#include <set>
#include <vector>
#include <list>
#include <queue>
#include <sstream>
#include <cmath>
#include <functional>
#include <climits>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define reps(s,i,n) for(int i=s;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define skip(i,n,p) for(int i=0;i<n;i+=p)
#define all(a)  (a).begin(),(a).end()
#define int64 long long
#define debug cerr << __FILE__ << ":" << __LINE__ << endl;
#define INF 2147483647

struct Init {
    Init() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout.precision(20);
        cout << fixed;
        // setw(6) << setfill('0')
    }
} init;

template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {
    for(int i = 0; i < (int) v.size(); i++) {
        ostr << v[i] << (i + 1 != v.size() ? " " : "");
    }
    return ostr;
}

template <typename _K, typename _V>
ostream& operator << (ostream& ostr, const map<_K, _V>& v) {
    ostr << "{";
    for (auto iter = v.begin(); iter != v.end(); ++iter) {
        ostr << (*iter).first << ": " << (*iter).second << ", ";
    }
    ostr << "}";
    return ostr;
}

template <typename _K>
ostream& operator << (ostream& ostr, const set<_K>& v) {
    for (auto iter = v.begin(); iter != v.end(); ++iter) {
        ostr << *iter << (iter != v.end() ? " " : "");
    }
    return ostr;
}

template <typename _K, typename _V>
ostream& operator << (ostream& ostr, const pair<_K, _V>& v) {
    ostr << "(" << v.first << ", " << v.second << ")";
    return ostr;
}

int64 powmod(int64 n, int64 count, int64 mod) {
    if (count == 0) return 1;
    if (count % 2 == 0) {
        int64 t = powmod(n, count / 2, mod);
        return t * t % mod;
    }
    return n * powmod(n, count - 1, mod) % mod;
}

int64 ncr(int64 n, int64 r, int64 mod) {
    int64 a;
    if (n < r) a = min(n, r - n);
    else a = min(n - r, r);

    int64 res = 1;
    rep(i, a) {
        res = res * (n - i) % mod;
        res = res * powmod(i + 1, mod - 2, mod) % mod;
    }

    return res;
}

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

    rep(i, S.size()) {
        int c = S[i] + N;
        if (c > 90) {
            c -= 26;
        }
        cout << char(c);
    }
    cout << endl;
}


Measured memory_bytes: 256
/*-----------------------------------------------,
|  __                                       __   |
| |  |--.-----.---.-.----.----.-----.-----.|  |_ |
| |  _  |  -__|  _  |  __|  __|  -__|  _  ||   _||
| |_____|_____|___._|____|____|_____|   __||____||
|                                   |__|         |
`-----------------------------------------------*/
#include<algorithm>
#include<array>
#include<bitset>
#include<cmath>
#include<complex>
#include <cstdint>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
typedef long long lint; using namespace std;
#define INF 2147483647
#define MOD 10000007
#define REP(counter, limit) for (long long counter = 0; counter < limit; counter++)
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool primenum(int a) { if (a == 1) { return false; }if (a == 2) { return true; }if (a % 2 == 0) { return false; }for (int i = 3; i < sqrt(a) + 1; i += 2) { if (a != i) { if (a % i == 0) { return false; } } }return true; }
struct setupios{setupios(){cin.tie(0);ios::sync_with_stdio(0); /*cout<<fixed<<setprecision(20);*/};}setupios;
int main() {

  long double a,b;
  cin>>a>>b;
  int64_t ans=a*b;
  cout<<ans<<endl;

}


Measured memory_bytes: 3780
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back

const int M = 1000000007;

int32_t main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n],b[n],f=0,cnt=0;
    for(int i=0;i<n;i++){
    	cin>>a[i]>>b[i];
    	if(a[i]==b[i]){
    		cnt++;
    	}
    	else{
    		cnt=0;
    	}
    	if(cnt>=3){
    		f=1;
    		break;
    	}
    }
    if(f==1){
    	cout<<"Yes";
    }
    else{
    	cout<<"No";
    }
    return 0;
}

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

constexpr int MOD = 998'244'353;

template<int mod> struct ModInt {
    int x;
    ModInt() : x(0) {}
    ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    ModInt &operator+=(const ModInt &p) { if((x += p.x) >= mod) x -= mod; return *this; }
    ModInt &operator-=(const ModInt &p) { if((x += mod-p.x) >= mod) x -= mod; return *this; }
    ModInt &operator*=(const ModInt &p) { x = (int)(1LL*x*p.x%mod); return *this; }
    ModInt &operator/=(const ModInt &p) { *this *= p.inverse(); return *this; }
    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }
    ModInt inverse() const {
        int a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) { t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); }
        return ModInt(u);
    }
    ModInt pow(long long e){
        long long a = 1, p = x;
        while(e > 0) {
            if (e & 1) {a = (a * p) % mod; e--;}
            else {p = (p * p) % mod; e /= 2;}
        }
        return ModInt(a);
    }
    friend ostream &operator<<(ostream &os, const ModInt<mod> &p) {
        return os << p.x;
    }
    friend istream &operator>>(istream &is, ModInt<mod> &a) {
        long long x;
        is >> x;
        a = ModInt<mod>(x);
        return (is);
    }
};

int main() {
	int n, s;
	cin >> n >> s;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	
	ModInt<MOD> dp[n + 1][s + 1];
    dp[0][0] = ModInt<MOD>(2).pow(n);
  
    ModInt<MOD> t = ModInt<MOD>(2).inverse();
  
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= s; j++) {
			dp[i + 1][j] += dp[i][j];
		}
		for (int j = 0; j <= s; j++) {
			if (j + a[i] <= s) {
				dp[i + 1][j + a[i]] += dp[i][j] * t;
			}
		}
	}
	
	cout << dp[n][s] << '\n';
	
	return 0;
}
	


Measured memory_bytes: 38820
#define NDEBUG
#include <bits/stdc++.h>
#define foi(i,k,n) for(int i = (int)k; i < (int)n; ++i)
using namespace std;
typedef long long ll;
const int MOD = 7 + 1000000000;
const int MAXN = 5 + 3000;
const int MAXF = 5 + 2 * 100000;

int fact[MAXF];

int fpow(int base, int exp) {
    int ans = 1, power = base;
    while(exp) {
        if(exp & 1) ans = (1LL * ans * power) % MOD;
        power = (1LL * power * power) % MOD;
        exp >>= 1;
    }
    return ans;
}

int ans[MAXN];
int inv(int k) {
    return fpow(k, MOD - 2);
}

int f(const pair<int,int>& p, const pair<int,int>& q) {
    int dx = abs(p.first - q.first), dy = abs(p.second - q.second);
    return (1LL * fact[dx+dy] * inv((1LL * fact[dx] * fact[dy]) % MOD)) % MOD;
}

void sub(int& p, const int& q) {
    assert(p >= 0 && p < MOD);
    assert(q >= 0 && q < MOD);
    p -= q;
    if(p < 0) p += MOD;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int H,W,N;
    cin >> H >> W >> N;
    vector<pair<int,int>> v; v.reserve(1+N);
    foi(i,0,N) {
        int x,y; cin >> x >> y;
        v.emplace_back(x,y);
    }
    fact[0] = 1;
    foi(i,1,MAXF) {
        fact[i] = (1LL * i * fact[i - 1]) % MOD;
    }
    v.emplace_back(H,W);
    sort(v.begin(),v.end());
    foi(i,0,v.size()) {
        ans[i] = f({1,1},v[i]);
    }
    foi(i,0,v.size()) {
        foi(j,1+i,v.size()) {
            if(v[i].first <= v[j].first && v[i].second <= v[j].second) {
                sub(ans[j], (1LL * ans[i] * f(v[i],v[j])) % MOD);
            }
        }
    }
    cout << ans[v.size() - 1] << '\n';
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
using namespace std;
int table[310][310];

int main(){
	int n;cin>>n;
	lol(i,n){
		lol(j,n){
			cin>>table[i][j];
		}
	}
	long long sum=0;
	bool ok=true;
	lol(i,n){
		lol(j,i){
			bool th=true;
			lol(k,n){
				if(i==j||i==k||j==k)continue;
				if(table[i][j]>table[i][k]+table[k][j]){
					ok=false;
				}
				if(table[i][j]==table[i][k]+table[k][j]){
					th=false;
				}
			}
			if(th)sum+=table[i][j];
		}
	}
	if(ok==false){
		cout<<"-1"<<endl;
		return 0;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 640
#include <cstdio>
bool f [100001];
int c [100002];
int N ,L , R ;
int main ()
{
    for ( int i =2; i <=100000; i ++) if (! f [ i ]) for ( int j = i + i ;j <=100000; j += i )
                f[ j ]= true ;
    for ( int i =3; i <=100000; i +=2) if (! f [ i ]&&! f [( i +1)/2]) c [ i ]++;
    for ( int i =3; i <=100000; i ++) c [ i ]+= c [i -1];
    scanf ("%d" ,& N );
    while (N--)
    {
        scanf ("%d %d" ,&L ,& R );
        printf ("%d\n" , c [ R ] - c [L -1]);
    }
}

Measured memory_bytes: 2176
import math

a,b,h,m = map(int,input().split())

#分針の角度(0分が0度)
d1 = 360 * m / 60
d2 = 360 * h / 12 + m * 0.5

alpha = abs(d1 - d2)

ans = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(alpha))
print(math.sqrt(ans))


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

typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 100005

int k;
string s;

int main()
{
    _FastIO;

    cin >> k;
    int a = k / 2;
    int b = a + k % 2;
    cout << a * b << endl;

    return 0;
}


Measured memory_bytes: 3636
#include<cstdio>

long long int blength(long long int n) {
    return (1LL<<(n+2)) - 3;
}

long long int func(long long int n, long long int x) {
    if (n == 0) {
        if (x == 1) return 1;
        else return 0;
    }
    if (x <= 1 + blength(n-1)) {
        return func(n-1, x-1);
    } else {
        return ( (1LL<<(n+1)) - 1 ) - func(n, blength(n)-x);
    }
}
int main() {
    long long int n, x;

    scanf("%lld%lld", &n, &x);
    printf("%lld\n", func(n, x));

    return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
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;}
constexpr int INF = 1e18;

signed main(){
	int X;
	cin >> X;
	FOR(i,-222,222){
		FOR(j,-222,222){
			if(i * i * i * i * i - j * j * j * j * j == X){
				out(i,j);
				return 0;
			}
		}
	}
}

Measured memory_bytes: 3676