akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(char &c){
  int i;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c = i;
}
inline int rd(char c[]){
  int i;
  int sz = 0;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c[sz++] = i;
  for(;;){
    i = getchar_unlocked();
    if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
char c;
int main(){
  rd(c);c += (1);
  wt_L(c);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200119-1

// --- original code ---
// char c;
// {
//   rd(c++);
//   wt(c);
// }


Measured memory_bytes: 256
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int64_t N;
  cin >> N;
  vector<int64_t> parts_a(N);
  for (int64_t n = 0; n < N; ++n) {
    cin >> parts_a[n];
  }
  sort(parts_a.begin(), parts_a.end());
  
  vector<int64_t> parts_b(N);
  for (int64_t n = 0; n < N; ++n) {
    cin >> parts_b[n];
  }
  
  vector<int64_t> parts_c(N);
  for (int64_t n = 0; n < N; ++n) {
    cin >> parts_c[n];
  }
  sort(parts_c.begin(), parts_c.end());
  
  int64_t result = 0;
  for (int64_t n = 0; n < N; ++n) {
    auto it = lower_bound(parts_a.begin(), parts_a.end(), parts_b[n]);
    int64_t a_num = (it - parts_a.begin());
    auto it2 = upper_bound(parts_c.begin(), parts_c.end(), parts_b[n]);
    int64_t b_num = (parts_c.end() - it2);
    result += a_num * b_num;
  }
  cout << result << endl;
  
  return 0;
}


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

int main() {
	int A, B, C, K;
	cin >> A >> B >> C >> K;
	rep(i, K) {
		if (A >= B) {
			B *= 2;
		} else {
			C *= 2;
		}
	}
	if (A < B && B < C) std::cout << "Yes" << '\n';
	else std::cout << "No" << '\n';
}


Measured memory_bytes: 3632
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  std::string S, T, U;
  i64 A, B;
  std::cin >> S >> T >> A >> B >> U;
  std::cout << A - (S == U ? 1 : 0) << ' ' << B - (T == U ? 1 : 0) << std::endl;
  return 0;
}

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

// clang-format off
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --(i))

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define endl '\n'
#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

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

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

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

vector< i64 > divisor(i64 n) {
  vector< i64 > ret;
  for(i64 i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

void solver() {
    i64 N = input();
    vector< i64 > d = divisor(N);
    
    i64 ans = 0;
    ans += divisor(N - 1).size() - 1;

    for (auto m: d) {
        if (m == 1) continue;
        i64 n = N;
        
        while (n % m == 0) n /= m;
        if (n % m == 1) ans++;
    }
    
    cout << ans << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  int ans = 0;
  int i = 0;
  while(vec.size() > 1) {
    ans = ans + vec.at(N - i - 1) - vec.at(N - i - 2);
    vec.pop_back();
    vec.pop_back();
    i += 2;
  }
  if(vec.size() == 1) {
    ans += vec.at(0);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

/**
 * Can't Wait for Holiday
 */
public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();

            int ans = 0;
            switch (S) {
                case "SUN":
                    ans = 7;
                    break;
                case "MON":
                    ans = 6;
                    break;
                case "TUE":
                    ans = 5;
                    break;
                case "WED":
                    ans = 4;
                    break;
                case "THU":
                    ans = 3;
                    break;
                case "FRI":
                    ans = 2;
                    break;
                case "SAT":
                    ans = 1;
                    break;
            }

            System.out.println(ans);
        }
    }

}


Measured memory_bytes: 21716
inf = float('inf')

N,M = map(int,input().split())
info = []
for _ in range(M):
    a,b,c = map(int,input().split())
    a -= 1; b -= 1
    info.append((a,b,c))
 
dist = [-inf for _ in range(N)]
dist[0] = 0
for i in range(N):
    for v,nv,w in info:
        if dist[nv] < dist[v] + w:
            dist[nv] = dist[v] + w
            if i == N-1 and nv == N-1:
                print("inf")
                exit()
ans = dist[N-1]
print(ans)

Measured memory_bytes: 3316
ai = lambda: list(map(int, input().split()))

n,a,b = ai()
x = ai()

ans = 0
for i in range(n-1):
    if a*(x[i+1]-x[i]) > b:
        ans += b
    else:
        ans += a*(x[i+1]-x[i])
print(ans)

Measured memory_bytes: 14484
from heapq import heappush, heappop
n,m = map(int,input().split())
work_dict = {}
for i in range(n):
    a,b = map(int,input().split())
    if not a in work_dict.keys():
        work_dict[a] = []
    work_dict[a].append(b)
hq = []
ans = 0
for i in range(1,m+1):
    if i in work_dict.keys():
        for j in range(len(work_dict[i])):
            heappush(hq, -work_dict[i][j])
    if len(hq) > 0:
        work = heappop(hq)
        ans += -work
print(ans)

Measured memory_bytes: 27352
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long N,M,ans=-1; cin>>N>>M;
  string s,t; cin>>s>>t;
  long long L, a=N, b=M, c=a%b;
  while(c!=0){
    a=b, b=c, c=a%b;
  }
  L=N*M/b;
  int x=L/N, y=L/M, z=min(N/y, M/x);
  for(int i=0; i<z; i++){
    if(s[i*y]!=t[i*x]) break;
    if(i==z-1) ans=L;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    StringTokenizer st = new StringTokenizer(s);

    int a = Integer.parseInt(st.nextToken());
    int b = Integer.parseInt(st.nextToken());

    if ((((a + b) % 3) == 0) || ((a % 3) == 0) || ((b % 3) == 0)) {
      System.out.println("Possible");
    } else {
      System.out.println("Impossible");
    }
  }

}


Measured memory_bytes: 23124
using System;

class MyClass
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        for (int i = 0; i < n; i++)
        {
            string str = Console.ReadLine();
            str = str.Replace("Hoshino", "Hoshina");
            Console.WriteLine(str);
        }
    }
}


Measured memory_bytes: 5308
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int n,L;
string s;

vector<int> merge(const vector<int> &f, const vector<int> &g){
    vector<int> h(n*n);
    rep(i,n*n) h[i] = g[f[i]];
    return h;
}

vector<int> pow(const vector<int> &f, int p){
    vector<int> g(f);

    vector<int> ret(n*n);
    iota(all(ret),0);

    while(p){
        if(p&1) ret = merge(ret, g);
        g = merge(g,g);
        p >>= 1;
    }
    return ret;
}

int number(int &idx){
    int ret = 0;
    while(idx<L && isdigit(s[idx])){
        ret = ret*10 + (s[idx]-'0');
        ++idx;
    }
    return ret;
}

vector<int> sequence(int &idx);
vector<int> repetition(int &idx);
vector<int> operation(int &idx);

vector<int> sequence(int &idx){
    vector<int> f(n*n);
    iota(all(f), 0);

    if(idx < L && s[idx] != ')'){
        if(s[idx] == '(') f = merge(f, repetition(idx));
        else f = merge(f, operation(idx));
    }

    return f;
}

vector<int> repetition(int &idx){
    ++idx;
    vector<int> f = sequence(idx);

    assert(s[idx]==')');
    ++idx;

    int num = number(idx);
    return merge(pow(f, num), sequence(idx));
}

vector<int> operation(int &idx){
    char op = s[idx];
    ++idx;
    int num = number(idx);
    --num;

    vector<int> f(n*n);
    iota(all(f), 0);

    if(op == 'R'){
        int v = f[num*n];
        for(int i=1; i<n; ++i) f[num*n + i-1] = f[num*n + i];
        f[num*n + n-1] = v;
    }
    else if(op == 'L'){
        int v = f[num*n + n-1];
        for(int i=n-1; i>0; --i) f[num*n + i] = f[num*n + i-1];
        f[num*n] = v;
    }
    else if(op == 'D'){
        int v = f[num];
        rep(i,n-1) f[i*n + num] = f[(i+1)*n + num];
        f[(n-1)*n + num] = v;
    }
    else if(op == 'U'){
        int v = f[(n-1)*n + num];
        for(int i=n-1; i>0; --i) f[i*n + num] = f[(i-1)*n + num];
        f[num] = v;
    }
    else assert(false);

    return merge(f, sequence(idx));
}

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

    int idx = 0;
    vector<int> f = sequence(idx);

    vector<vector<int>> a(n, vector<int>(n));
    rep(i,n*n){
        int pos = f[i];
        a[pos/n][pos%n] = i+1;
    }

    rep(i,n){
        rep(j,n) printf("%d%c", a[i][j], " \n"[j==n-1]);
    }

    return 0;
}



Measured memory_bytes: 17460
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,y;
  cin >> n >> y;
  
  y/=1000;
  
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      if(i*10+j*5+n-j-i==y&&i+j<=n){
        printf("%d %d %d",i,j,n-j-i);
        i=n+1;
      }
    }
    if(i==n)
      printf("%d %d %d",-1,-1,-1);
  }
}

Measured memory_bytes: 256
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int N;
int W;
long long dp[1001][1001];
int main(void) {
    int count = 1;
    while (1) {
        cin >> W;
        if (W == 0) break;
        cin >> N;
        vector<int> w, v;
        for (int i = 0; i < N; i++) {
            int tmp, tmp2;
            scanf("%d, %d", &tmp, &tmp2);
            v.push_back(tmp);
            w.push_back(tmp2);
        }
        // dp[i][j]はjまでで重さがiまで選んでいるとき得られる最高の価値
        for (int i = 0; i <= N; i++) {
            for (int j = 0; j <= W; j++) {
                dp[i][j] = -1;
            }
        }
        dp[0][0] = 0;
        // 議論の中核
        for (int i = 0; i < N; i++) {
            for (int j = 0; j <= W; j++) {
                if (dp[i][j] != -1 && j + w[i] <= W) {
                    dp[i+1][j+w[i]] = max(dp[i+1][j+w[i]], dp[i][j] + v[i]);
                }
                dp[i+1][j] = max(dp[i][j], dp[i+1][j]);
            }
        }
        // 答えのチェック
        int topvalue = 0, indexweight = 0;
        for (int j = 0; j <= W; j++) {
            if (topvalue < dp[N][j]) {
                topvalue = dp[N][j];
                indexweight = j;
            }
        }
        cout << "Case " << count << ":" << endl;
        cout << topvalue << endl;
        cout << indexweight << endl;
        count++;
        for (int i = 0; i <= N; i++) {
            for (int j = 0; j <= W; j++) {
                dp[i][j] = -1;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 9108
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstdlib>

int N;
std::vector< std::vector< std::pair<int,long> > > to;
int q, k;
std::vector<long long int> length;

void dig(int i, int p, long long int s){
    length[i] = s;

    for(auto x : to[i]){
        if(x.first == p) continue;

        dig(x.first, i, s+x.second);
    }
}

int main(void){
    int a, b;
    long c;
    std::cin >> N;
    to.resize(N);

    for(int i=0; i<N-1; ++i){
        std::cin >> a >> b >> c;
        --a, --b;
        to[a].push_back(std::make_pair(b, c));
        to[b].push_back(std::make_pair(a, c));
    }

    int x, y;
    std::cin >> q >> k;

    length.resize(N, 0);
    dig(k-1, -1, 0);

    for(int i=0; i<q; ++i){
        std::cin >> x >> y;
        std::cout << length[x-1] + length[y-1] << std::endl;
    }
}


Measured memory_bytes: 14336
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <map>
#include <stack>
using namespace std;

#define mod 1000000007
#define ten5 100005
#define ten52 200005
#define ten6 1000005
#define PI 3.1415926

typedef long long int ll;

//ll chk[55];
//ll num[55];
//ll num2[55];
//ll num[ten5];
//ll num2[ten5];
//char cmap[10][10];
//priority_queue<long long int> pq;   //big at front
//stack<int> stk;
//vector<pair<ll,ll>> vint;
//vector<ll> vtime;
//deque<ll> deq[55];
//list<int> li;
//set<int> sint;
//set<ll> sll;
map<ll,ll> mp;


int main()
{
    //double ans=0.0,half;
    //float f,g,h;
    long long int sum,sum2,n1,n2,n3;
    long long int m,n,o,i,j,k=1;
    long long int a,a1,a2,a3,a4,a5,a6;
    sum=sum2=n1=n2=n3=0;
    a=a1=a2=a3=a4=a5=a6=0;
    //string s,s1;
    //char now,pre,c;
    cin>>n;
    a=n/11;
    n%=11;
    if(n>6) cout<<a*2+2;
    else if(n<=6 && n!=0) cout<<a*2+1;
    else cout<<a*2;
    return 0;
}



Measured memory_bytes: 256
from decimal import *
n, k = map(int,input().split())
a = list(map(int,input().split()))
inner = 0
outer = 0
for i in range(0,n):
    for j in range(0,n):
        if a[i] > a[j]:
            outer += 1
            if i < j:
                inner += 1

print((Decimal(((inner) * (k)) + Decimal((outer) * Decimal((k) * (k-1)) / 2))%(1000000007)))





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

using ll = long long;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define pb push_back
#define mp make_pair
#define fill(x, y) memset(x, y, sizeof(x))
#define even(x) x % 2 == 0
#define odd(x) x % 2 != 0
#define all(x) x.begin(), x.end()
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

// these functions return the position of result of Binary Search.
#define LB(s, t, x) (int) (lower_bound(s, t, x) - s)
#define UB(s, t, x) (int) (upper_bound(s, t, x) - s)

ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1) ans = 1ll * ans * a % mo; a = 1ll * a * a % mo; } while (b >>= 1); return ans; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int dx8[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy8[] = { 0, 0, -1, 1, -1, 1, -1, 1 };

template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts>
auto make_v(size_t a, size_t b, Ts... ts) { return vector<decltype(make_v<T>(b, ts...))>(a, make_v<T>(b, 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); }
// auto dp = make_v<int>(4, h, w);
// fill_v(dp, 0);

const ll INF_LL = (1ll << 60);
const int INF_INT = (int)1e9;
const ll MOD_CONST = (ll)(1e9 + 7);

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

inline tuple<ll, ll> rotate45(tuple<ll, ll> p) { ll x = get<0>(p), y = get<1>(p); return tuple<ll, ll>(x + y, x - y); }
inline bool rangeCheck2D(int nx, int ny, int Width, int Height) { return nx >= 0 and nx < Width and ny >= 0 and ny < Height; }

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

	ll A, B, C, K; cin >> A >> B >> C >> K;
	cout << ((K % 2 == 0) ? A - B : B - A) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N , D ,X; cin >> N >> D >> X;
  int count= 0;
  int sum = 0;
  int b,n,a;
  n = 1;
  a = 0;
  vector<int> vec(N);
  for (int i = 0; i < N; i++)
  {
    cin >> vec[i]; 
  }
  for (int j = 0; j < N;j++){
     a = vec[j];
     b = vec[j];
    
    if(a == D){
      a++;
    }
    while( a <= D){
      a = b * n + 1;
      n++;
      if(a <= D){
       
        sum++;
      }
      if(a > D){
        break;
      }
    }
    n = 1;
    
  }
  cout << sum + N + X<< endl;
}


Measured memory_bytes: 256
def main4():
    N, M, K = map(int, input().split())
    A = [int(a) for a in input().split()]
    B = [int(b) for b in input().split()]
    Bsum = sum(B)
    ans = Asum = 0
    idx_b = len(B) - 1

    for i in range(N + 1):

        if i == 0:
            Asum += 0
        else:
            Asum += A[i - 1]

        while Asum + Bsum > K:
            if idx_b >= 0:
                Bsum -= B[idx_b]
                idx_b -= 1
            else:
                break

        if Asum + Bsum <= K:
            ans = max(ans, i + idx_b + 1)

    print(ans)

if __name__ == "__main__":
    main4()

Measured memory_bytes: 40660
import java.util.Scanner

import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val arr = Array.fill(n)(readLine())

  def solve() = {
    val map = Map(
      "AC" -> 0,
      "WA" -> 0,
      "TLE" -> 0,
      "RE" -> 0,
    )
    val ans = arr.foldLeft(map) { case (acc, str) =>
      acc.updated(str, acc.getOrElse(str, 0)+1)
    }
    s"""
       |AC x ${ans("AC")}
       |WA x ${ans("WA")}
       |TLE x ${ans("TLE")}
       |RE x ${ans("RE")}
     """.stripMargin
  }


  println(solve())

}



Measured memory_bytes: 61672
/*░░░░░░░▄▄▄▀▀▀▄▄███▄
░░░░░▄▀▀░░░░░░░▐░▀██▌
░░░▄▀░░░░▄▄███░▌▀▀░▀█
░░▄█░░▄▀▀▒▒▒▒▒▄▐░░░░█▌
░▐█▀▄▀▄▄▄▄▀▀▀▀▌░░░░░▐█▄
░▌▄▄▀▀░░░░░░░░▌░░░░▄███████▄
░░░░░░░░░░░░░▐░░░░▐███████████▄
░░░░░le░░░░░░░▐░░░░▐█████████████▄
░░░░toucan░░░░░░▀▄░░░▐██████████████▄
░░░░░░has░░░░░░░░▀▄▄████████████████▄
░░░░░arrived░░░░░░░░░░░░█▀██████*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

const int MAXN = 200 * 1000 + 7;
vector<int> g[3][MAXN];
int color[3][MAXN];
int sz[3][MAXN];
bool used[MAXN];
void dfs(int v, int gg, int col)
{
	sz[gg][col]++;
	used[v] = true;
	color[gg][v] = col;
	for (int i = 0; i < (int)g[gg][v].size(); i++)
	{
		int to = g[gg][v][i];
		if (!used[to])
		{
			dfs(to, gg, col);
		}
	}
}
int main()
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
	int n;
	scanf("%d", &n);
	int m1, m2;
	scanf("%d %d", &m1, &m2);
	for (int i = 1; i <= m1; i++)
	{
		int a, b;
		scanf("%d %d", &a, &b);
		g[1][a].push_back(b);
		g[1][b].push_back(a);
	}
	for (int i = 1; i <= m2; i++)
	{
		int a, b;
		scanf("%d %d", &a, &b);
		g[2][a].push_back(b);
		g[2][b].push_back(a);
	}
	int goColor = 1;
	for (int i = 1; i <= n; i++)
	{
		if (!used[i])
		{
			dfs(i, 1, goColor);
			goColor++;
		}
	}
	memset(used, false, sizeof(used));
	goColor = 1;
	for (int i = 1; i <= n; i++)
	{
		if (!used[i])
		{
			dfs(i, 2, goColor);
			goColor++;
		}
	}
	map<pair<int, int>, int> cnt;
	for (int i = 1; i <= n; i++)
	{
		cnt[make_pair(color[1][i], color[2][i])]++;
	}
	for (int i = 1; i <= n; i++)
	{
		int res = cnt[make_pair(color[1][i], color[2][i])];
		printf("%d ", res);
	}
	printf("\n");
}


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

int main() {
  int a, b;
  cin>>a>>b;
  if (a != 1 && b != 1) {
    cout<<1<<endl;
  } else if (a != 2 && b != 2) {
    cout<<2<<endl;
  } else {
    cout<<3<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <complex>

using namespace std;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;

int n, m;

bool works(int d) {
    return m % d == 0 and m / d >= n;
}

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

    scanf(" %d %d", &n, &m);

    int ans = 1;
    for (int d = 1; d * d <= m; ++d) {
        if (m % d == 0 and works(d))
            ans = max(ans, d);
        if (m % d == 0 and works(m / d))
            ans = max(ans, m / d);
    }

    printf("%d\n", ans);
    
    return 0;
}


Measured memory_bytes: 256
S = input()
a = 0
b = 0

for i in range(len(S)):
  if (i + 1) % 2 == 0:
    if S[i] == "0":
      a += 1
    else:
      b += 1
  else:
    if S[i] == "1":
      a += 1
    else:
      b += 1
print(min(a,b))

Measured memory_bytes: 3188
sx,sy,tx,ty = map(int,input().split())
y=ty-sy
x=tx-sx
print("U"*y+"R"*x+"D"*y+"L"*x+"L"+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U")

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

using namespace std;

#define ll  long long
#define ld  double

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

#define pb  emplace_back
#define X   first
#define Y   second

const int   N   = 505;

typedef pair<int,int>   ii;

ll  f[N][N];
ll  s_r[N][N];
ll  s_c[N][N];

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

    int n;  cin >> n;

    for(int i = 1 ; i <= n ; ++i)
    for(int j = 1 ; j <= n ; ++j)   {
        int x = 0;
        int y = 0;

        if (i < j)  cin >> x;
        if (i > j)  cin >> y;

        s_r[i][j] = x + s_r[i][j - 1] + s_r[i - 1][j] - s_r[i - 1][j - 1];
        s_c[i][j] = y + s_c[i][j - 1] + s_c[i - 1][j] - s_c[i - 1][j - 1];
    }
    for(int i = 0 ; i <= n ; ++i)
    for(int j = 0 ; j <= n ; ++j)
        f[i][j] = 1e18;

    f[0][0] = 0;

    for(int i = 0 ; i <  n ; ++i)
    for(int j = 0 ; j <= i ; ++j)   if (f[i][j] < 1e18)
        for(int k = i + 1 ; k <= n ; ++k)   {
            ll  nxt = f[i][j];

            nxt += s_r[k][k] + s_r[i][i] - s_r[k][i] - s_r[i][k];
            nxt += s_c[n][i] + s_c[k][j] - s_c[k][i] - s_c[n][j];

            if (f[k][i] > nxt)
                f[k][i] = nxt;
        }

    cout << *min_element(f[n],f[n] + 1 + n) << endl;
}

Measured memory_bytes: 6272
// writer: w33z8kqrqk8zzzx33
#include <bits/stdc++.h>
using namespace std;
 
#define iter(i, a, b) for(int i=(a); i<(b); i++)
#define rep(i, a) iter(i, 0, a)
#define rep1(i, a) iter(i, 1, (a)+1)
#define log(a) cerr<<"\033[32m[DEBUG] "<<#a<<'='<<(a)<<" @ line "<<__LINE__<<"\033[0m"<<endl
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using ll=long long;
using pii=pair<int, int>;
//#define int ll
int MOD = 1000000007;

int mc[10004];

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int N, P; cin >> N >> P;
    string S; cin >> S;
    if(P == 2 || P == 5) {
        ll ans = 0;
        rep(i, N) if((S[i]-'0')%P == 0) ans += (i+1);
        cout << ans << endl;
        return 0;
    } else {
        int ps=0,c=1;
        ll ans=0;
        mc[0]++;
        reverse(all(S));
        rep(i,N) {
            ps=(ps+c*(S[i]-'0'))%P,c=c*10%P;
            ans+=mc[ps];
            mc[ps]++;
        }
        cout << ans << endl;
    }
}



Measured memory_bytes: 720
H, W, K = gets.chomp.split(" ").map(&:to_i)
M = []
M << Array.new(W+2, nil)
H.times do |i|
  mm = gets.chomp.split(//)
  M << [nil, mm, nil].flatten
end
M << Array.new(W+2, nil)

ANS = Array.new(H+2)
(H+2).times do |i|
  ANS[i] = Array.new(W+2, nil)
end

def fill_arround(h, w, k)
  ANS[h][w] = k
  step = { up: 0, down: 0, left: 0, right: 0 }
  while M[h - step[:up] - 1][w] == "." && ANS[h - step[:up] - 1][w].nil?
    step[:up] += 1
  end
  while M[h + step[:down] + 1][w] == "." && ANS[h + step[:down] + 1][w].nil?
    step[:down] += 1
  end
  while M[h][w - step[:left] - 1] == "." && ANS[h][w - step[:left] - 1].nil?
    step[:left] += 1
  end
  while M[h][w + step[:right] + 1] == "." && ANS[h][w + step[:right] + 1].nil?
    step[:right] += 1
  end

  # up-left
  up = step[:up]
  1.upto(up) { |u| ANS[h - u][w] = k }
  left = 0
  1.upto(step[:left]) do |l|
    ok = true
    0.upto(up) do |u|
      if M[h - u][w - l] != "." || !ANS[h - u][w - l].nil?
        ok = false
        break
      end
    end
    break unless ok

    left = l
    0.upto(up) do |u|
      ANS[h - u][w - l] = k
    end
  end

  # up-right
  right = 0
  1.upto(step[:right]) do |r|
    ok = true
    0.upto(up) do |u|
      if M[h - u][w + r] != "." || !ANS[h - u][w + r].nil?
        ok = false
        break
      end
    end
    break unless ok

    right = r
    0.upto(up) do |u|
      ANS[h - u][w + r] = k
    end
  end

  # down
  down = 0
  1.upto(step[:down]) do |d|
    ok = true
    (-left).upto(right) do |i|
      if M[h + d][w + i] != "." || !ANS[h + d][w + i].nil?
        ok = false
        break
      end
    end
    break unless ok

    down = d
    (-left).upto(right) { |i| ANS[h + d][w + i] = k }
  end
end

k = 0
1.upto(H) do |h|
  1.upto(W) do |w|
    if M[h][w] == "#"
      k += 1
      fill_arround(h, w, k)
    end
  end
end

1.upto(H) do |h|
  puts ANS[h][1..-2].join(" ")
end


Measured memory_bytes: 13308
import math

n, k = map(int, input().strip().split())


prob = 0
for m in range(1, n + 1):
    if m >= k:
        prob += 1 / n
    else:
        p = math.ceil(math.log(k / m) / math.log(2))
        prob += (1 / n) / (2 ** p)

print(prob)


Measured memory_bytes: 3188
//Author: Fuadul Hasan(fuadul202@gmail.com)
#include<bits/stdc++.h>
using namespace std;

#define ll long long
const int N   = 2e5 + 5;

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

	if(n >= 400 and n <= 599){
		cout<<8<<endl;
	}else if(n >= 600 and n <= 799){

		cout<<7<<endl;
	}else if(n >= 800 and n <= 999){
		cout<<6<<endl;
	}else if(n >= 1000 and n <= 1199){
		cout<<5<<endl;
	}else if(n >= 1200 and n <= 1399){
		cout<<4<<endl;
	}else if(n >= 1400 and n <= 1599){
		cout<<3<<endl;
	}else if(n >= 1600 and n <= 1799){
		cout<<2<<endl;
	}else if(n >= 1800 and n <= 1999){
		cout<<1<<endl;
	}


	

	return 0;
}

Measured memory_bytes: 3632
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();

		System.out.println(Math.max(C-(A-B), 0));
		
		sc.close();
	}
}


Measured memory_bytes: 21972
#include<stdio.h>

int main(){
    int r,c,sum;
    scanf("%d %d",&r,&c);
    int table[r+1][c+1] = {};
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c;j++){
            scanf("%d",&table[i][j]);
            table[r][j] += table[i][j];
            table[i][c] += table[i][j];
            table[r][c] += table[i][j];
        }
    }
    table[r+1][c+1] = sum;
    
    for(int i = 0;i < r+1;i++){
        for(int j = 0;j < c+1;j++){
            if(j != c){
                printf("%d ",table[i][j]);
            } else {
                printf("%d\n",table[i][j]);
            }
        }
    }
    return 0;
}



Measured memory_bytes: 2720
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define V vector<int>
#define ll long long
using namespace std;


int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i, 0, n) cin >> a[i];

    int ans = 0;
    int x = 1;
    rep(i, 0, n) {
        if(a[i] != x) ans++;
        else {
            x++;
        }
    }
    if(x == 1) cout << -1 << endl;
    else cout << ans << endl;
}


Measured memory_bytes: 1024
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        for (int i = 0; i < 6; i++) {
            if (s.charAt(i) == '1') {
                ans++;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 23124
#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,k;
    cin >> n >> k;
    string s;
    cin >> s;

    vector<int> st;
    int cnt=0;
    char ref=s[0];
    for(int i = 0; i < n; i++) {
        if(s[i]==ref) cnt++;
        else{
            st.emplace_back(cnt);
            ref=s[i];
            cnt=1;
        }
    }
    if(cnt!=0) st.emplace_back(cnt);
    if(s[0]=='0') st.insert(st.begin(),0);
    if(s[n-1]=='0') st.emplace_back(0);

    vector<int> b(st.size()+1);
    b[0]=0;
    for(int i = 0; i < st.size(); i++) {
        b[i+1]=b[i]+st[i];
    }

    int ans=0;
    for(int i = 0; i < st.size(); i+=2) {
        int tans;
        tans=b[min((int)st.size(),i+2*k+1)]-b[i];
        ans=max(tans,ans);
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 1272
#include <stdio.h>
#include <string.h>

int main(void){
    char s[1001],t[1001];
    int countnum,i,j,k,diff=0,ans=2000;
    scanf("%s",s);
    scanf("%s",t);
    // strlen(s)-strlen(t)+1 ←カウントする回数
    countnum = (int)(strlen(s)-strlen(t))+1;
    for(i=0;i<countnum;i++){
        diff = 0;
        for(j=0;j<(int)strlen(t);j++){
            k=i+j;
            if(s[k] != t[j]){
                diff++;
            }
        }
        if(diff<ans){
            ans = diff;
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 1728
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
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;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll digsz(ll x){if(x==0) return 1;else{ll ans=0;while(x){x/=10;ans++;}return ans;}}
ll digsum(ll x){ll sum=0;while(x){sum+=x%10;x/=10;}return sum;}
vector<ll> pw2(62,1);vector<ll> pw10(19,1);


int main(){
    {rep1(i,61) pw2[i]=2*pw2[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    ll N; cin>>N;
    vector<P> C(N);
    rep(i,N){
        ll x,y; cin>>x>>y;
        
        C[i].a=y;
        C[i].b=x;
    }
    sort(all(C));
    
    ll tmp=0;
    rep(i,N){
        tmp+=C[i].b;
        if(tmp>C[i].a){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


Measured memory_bytes: 6408
/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }

void solve() {
	int a; cin >> a;
    cout << a + a * a + a * a * a << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

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

int main()
{
    for (int i = 0; i < 3000; ++i)
    {
        int x = 0, y = 0;
        cin >> x >> y;
        if (x == 0 && y == 0)
            break;
        if (x > y)
            swap(x, y);
        cout << x << " " << y << endl;
    }
    return 0;
}



Measured memory_bytes: 3088
from itertools import product
n = input()
k = int(input())
dp = [[[0] * (k + 2) for _ in range(2)] for _ in range(len(n) + 1)]
dp[0][0][0] = 1
for i, j, l in product(range(len(n)), range(2), range(k + 1)):
    for x in range(10):
        if j == 0 and x > int(n[i]):
            continue
        dp[i + 1][0 if j == 0 and x == int(n[i]) else 1][l + 1 if x != 0 else l] += dp[i][j][l]
print(dp[len(n)][0][k] + dp[len(n)][1][k])

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

class Program
{
    static int F(int s)
    {
        int ctr = 0;
        while (s % 100 == 0)
        {
            ctr++;
            s /= 100;
        }
        return ctr;
    }

    public static void Main()
    {
        var s = Console.ReadLine().Split(' ');
        int D = int.Parse(s[0]);
        int N = int.Parse(s[1]);
        int ctr = 0;
        for (int i = 1; ; i++)
        {
            if (D == F(i))
                ctr++;
            if (ctr == N)
            {
                Console.WriteLine(i);
                break;
            }
        }
    }
}

Measured memory_bytes: 11092
// Bowen Yu
// NYU - Progteam

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

const int INF = (int)1E9;
#define MAXN 100005

char str[MAXN];
int main() {
  int x, max = 0;
  set<int> maxS;
  map<int,int> m;
  while (cin >> x) {
    if ( m.find(x) == m.end() ) {
      m[x] = 1;
    } else {
      m[x] = m[x] + 1;
    }

    if (m[x] > max) {
      max = m[x];
      maxS.clear();
      maxS.insert(x);
    } else if (m[x] >= max) {
      maxS.insert(x);
    }
  }

  for (set<int>::iterator it=maxS.begin(); it!=maxS.end(); ++it)
    cout << *it << endl;

  return 0;
}

Measured memory_bytes: 1196
while True:
    n = int(input())
    if n == 0:
        break
    ans = 0
    start, end = 1, 3
    while end <= n:
        if sum(range(start, end)) < n:
            end += 1
        elif sum(range(start, end)) > n:
            start += 1
        elif sum(range(start, end)) == n:
            ans += 1
            end += 1
    print(ans)



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

int main(){
  int n, m, l, a[100][100], b[100][100];
  long int c[100][100] = {0};
  cin >> n >> m >> l;
  for(int i = 0; i < n; i++){
  	for(int j = 0; j < m; j++){
  		cin >> a[i][j];
  	}
  }
  for(int i = 0; i < m; i++){
  	for(int j = 0; j < l; j++){
  		cin >> b[i][j];
  	}
  }
   for(int i = 0; i < n; i++){
   	for(int j = 0; j < l; j++){
   		for(int k = 0; k < m; k++){
   			c[i][j] = c[i][j]+a[i][k]*b[k][j];
   		}
  	}
  }
  for(int i = 0; i < n; i++){
  	cout << c[i][0];
  	for(int j = 1; j < l; j++){
  		cout << ' ' << c[i][j];
  	}
  	cout << endl;
  }
  return 0;
}


Measured memory_bytes: 3236
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC087A
{
    class Program
    {
        static void Main(string[] args)
        {
            int X, a, b, c;

            X = int.Parse(Console.ReadLine());
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());

            c = (X - a) % b;

            Console.WriteLine(c);

            Console.ReadKey();

        }
    }
}


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

int main(){
  string S;
  cin >> S;
  if (S == "Sunny") cout << "Cloudy" << endl;
  else if (S == "Cloudy") cout << "Rainy" << endl;
  else if (S == "Rainy") cout << "Sunny" << endl;
  return 0;
}

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

int main(){
  int A[3];
  cin >> A[0] >> A[1] >> A[2];
  if(A[0]+A[1]+A[2]>=22){
    cout << "bust" << endl;
  } else {
    cout << "win" << endl;
  }
  return 0;
}

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

int main() {
  int H,W;
  cin >> H >> W;
  for(int i=0;i<W+2;i++){
    cout << "#";
  }
  cout << endl;
  vector<string> A(H);
  for(int i=0;i<H;i++){
    cin >> A.at(i);
    cout << "#" << A.at(i) << "#" << endl;
  }
  for(int i=0;i<W+2;i++){
    cout << "#";
  }
  cout << endl;
}

Measured memory_bytes: 256
/*
  Author: Alokit Kumar
  */
 #include<bits/stdc++.h>
 using namespace std;
 #define int long long
 int32_t main()
 {
   int t,n,i,j,k,l;
   char ch;
   cin>>ch;
   if(ch>='A'&&ch<='Z') cout<<"A";
   else cout<<"a";
 }

Measured memory_bytes: 3644
import Foundation

extension String {
    func wordsMap<T>(_ f: (Substring) -> T?) -> [T] {
        return self.split(separator: " ").compactMap(f)
    }
}

private func readWords<T>(_ f: (Substring) -> T?) -> [T] {
    return readLine()!.wordsMap(f)
}

extension Optional {
    func pleaseAC(){
        print(self!)
    }
}

readLine().map { line -> Any in 
    let n = Int(line)!
    var ans = [String:Int]()

    for _ in 1...n {
        let s = readLine()!
        ans[s, default: 0] += 1
    }

    for s in ["AC","WA","TLE","RE"] {
        print("\(s) x \(ans[s] ?? 0)")
    }
    
    return ""
}
.pleaseAC()


Measured memory_bytes: 13424
use std::io::*;
use std::str::FromStr;
use std::f32::consts::PI;

fn main() {
    let r: f32 = read();
	let ans = 2_f32*PI*r;
	println!("{}", ans);
}

fn read<T: FromStr>() -> T {
	let stdin = stdin();
	let stdin = stdin.lock();
	let token: String = stdin
		.bytes()
		.map(|c| c.expect("failed to read char") as char)
		.skip_while(|c| c.is_whitespace())
		.take_while(|c| !c.is_whitespace())
		.collect();
	token.parse().ok().expect("failed to parse token")
}


Measured memory_bytes: 2128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

int main(){ 
  int n;
  cin >> n;
  vector<ll> a(n), b(n);
  rep(i,n) cin >> a[i] >> b[i];
  ll res = 0;
  for (int i = n-1; i >= 0; i--) {
    (a[i] += res) %= b[i];
    if (a[i]) res += b[i] - a[i];
  }
  cout << res << endl;
  return 0;
} 

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

int main() {
    int64_t x; cin >> x;
    for(int64_t a = -1000; a < 1000; ++a) {
        for(int64_t b = -1000; b < 1000; ++b) {
            if(a*a*a*a*a - b*b*b*b*b == x) {
                cout << a << " " << b << '\n';
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3632
import java.util.Scanner;

class Main{
	static int f(String SA, String SB, String SC, int c) {
		if(c == 1) {
			if(SA.length() == 0) return 1;
			int next = (SA.charAt(0) == 'a') ? 1 : (SA.charAt(0) == 'b') ? 2 : 3;
			return f(SA.substring(1), SB, SC, next);
		}else if(c == 2) {
			if(SB.length() == 0) return 2;
			int next = (SB.charAt(0) == 'a') ? 1 : (SB.charAt(0) == 'b') ? 2 : 3;
			return f(SA, SB.substring(1), SC, next);
		}else {
			if(SC.length() == 0) return 3;
			int next = (SC.charAt(0) == 'a') ? 1 : (SC.charAt(0) == 'b') ? 2 : 3;
			return f(SA, SB, SC.substring(1), next);
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String SA = sc.next(), SB = sc.next(), SC = sc.next();
		int win = f(SA, SB, SC, 1);
		System.out.println(win == 1 ? "A" : win == 2 ? "B" : "C");
	}
}

Measured memory_bytes: 22996
#include <iostream>
#include <math.h>
#include <string.h>
#include <vector>


using namespace std;

int main() {
    string b;
    cin>>b;
    if(b=="A")cout<<'T';
    if(b=="T")cout<<'A';
    if(b=="G")cout<<'C';
    if(b=="C")cout<<'G';
    cout<<endl;
    
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

typedef pair<double, double> pdd;

#define x first
#define y second


void solve(vector<pdd>& data)
{
    double area = 0.0;
    
    pdd v1, v2;

    for (int i = 0; i < static_cast<int>(data.size()) - 1; ++i) {
        v1.x = data.at(i).x - data.at(0).x;
        v1.y = data.at(i).y - data.at(0).y;
        v2.x = data.at(i + 1).x - data.at(0).x;
        v2.y = data.at(i + 1).y - data.at(0).y;

        double temp_area = abs(v1.x * v2.y - v1.y * v2.x) / 2;

        area += temp_area;
    }

    cout << area << endl;
}


int main()
{
    vector<pdd> pointData;
    
    double x, y;
    char comma;
    
    while (cin >> x >> comma >> y) {
        pointData.push_back(pdd(x, y));
    }

    solve(pointData);   

    return 0;
}
    

Measured memory_bytes: 1288
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
            
       
         if(b<a){
            if(a<c){
                System.out.println(b+" "+a+" "+c);
            }else if(c<a && b<c){
                System.out.println(b+" "+c+" "+a);
            }else{
                System.out.println(c+" "+b+" "+a);
            }
         }else if(a<b){
            if(b<c){
                    System.out.println(a+" "+b+" "+c);
            }else if(b<a){
                    System.out.println(a+" "+c+" "+b);
           }else{
                	System.out.println(c+" "+a+" "+b);
       	   }
        }
    }
}


Measured memory_bytes: 26076
#include<cstdio>
#include<cmath>
int a,b,h,m;
double szj,fzj,j,ans;
int main()
{
	scanf("%d%d%d%d",&a,&b,&h,&m);
	szj=(h*60+m)*0.5;
	fzj=m*6;
	j=fabs(szj-fzj);
	if(j>180)	j=360-j;
	ans=sqrt(a*a+b*b-2*a*b*cos(j*M_PI/180));
	printf("%.20f",ans);
	return 0;
}

Measured memory_bytes: 2564
while True:
    m,f,r = map(int,input().split())
    d = m+f
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1 or d < 30:
        print("F")
    
    elif d >= 80:
        print("A")
    elif d>= 65 and d <80:
        print("B")
    elif (d >= 50 and d < 65) or (d>=30 and d< 50 and r >= 50):
        print("C")
    elif d>=30 and d< 50 and r<50:
        print("D")
    


Measured memory_bytes: 5592
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fi first
#define se second
#define pb push_back 
using namespace std;

int l,x,fa[200005],num,son[200005],ne[400005],li[400005],s[200005],y,n;

void dfs(int x){
	int l=son[x],y;
	s[x]=1;
	while (l>0) {
		y=li[l];
		if (fa[y]==-1) {
			fa[y]=x;
			dfs(y);
			s[x]+=s[y];
		}
	l=ne[l];
	}
}


int main(){
	scanf("%d",&n);
	rep(i,1,n) {
		scanf("%d%d",&x,&y);
		l++;
		ne[l]=son[x];
		son[x]=l;
		li[l]=y;
		l++;ne[l]=son[y];
		son[y]=l;
		li[l]=x;
	}
	memset(fa,-1,sizeof(fa));
	fa[n]=0;
	dfs(n);
	x=1;
	while (x!=n) {
		num++;x=fa[x];
	}
	x=1;
	rep(i,0,num/2) {
		x=fa[x];
	}
	if (s[x]>s[n]-s[x]) printf("Fennec");else printf("Snuke");

}

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

const ll mod = 1e9 + 7;
const ll MAXX = 1e18;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen("INP.txt", "r", stdin);
	//freopen("OUT.txt", "w", stdout);
	ll n;
	cin >> n;
	for (ll i = 1; i <= 9; i++) {
		if (n % i == 0 && n / i > 0 && n / i < 10) {
			cout << "Yes" << '\n';
			return 0;
		}
	}
	cout << "No" << '\n';
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int m=n%10;
  if(m==3)
  {
    cout<<"bon"<<endl;
  }
  else if(m==0||m==1)
  {
    cout<<"pon"<<endl;
  }
  else if(m==6||m==8)
  {
    cout<<"pon"<<endl;
  }
  else
  {
    cout<<"hon"<<endl;
  }
  return 0;
}

Measured memory_bytes: 3628