akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main()
{
    string str[1000];
    int ranks, columns;
    cin >> ranks >> columns;
    for (int i = 0; i < ranks; i++) {
        cin >> str[i];
        str[i] = str[i] + str[i];
    }
    for (int i = 0; i < ranks; i++) {
        for (int j = 0; j < str[i].length() / 2; j++) {
            cout << str[i][j];
        }
        cout << endl;
        for (int j = str[i].length() / 2; j < str[i].length(); j++) {
            cout << str[i][j];
        }
        cout << endl;
    }

    return 0;
}

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

public class Main {

	/** 区切り文字 */
	static final String REGEX = ",";

	/** インキ滴の小 */
	static final int SMALL_SIZE = 1;

	/** インキ滴の中 */
	static final int MIDIAM_SIZE = 2;

	/** インキ滴の大 */
	static final int LARGE_SIZE = 3;

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		int[] field = new int[101];
		int x;
		int y;
		int size;
		while (true) {
			String line = reader.readLine();
			if (line == null || line.isEmpty()) {
				break;
			}
			String[] str = line.split(REGEX);
			x = Integer.valueOf(str[0]);
			y = Integer.valueOf(str[1]);
			size = Integer.valueOf(str[2]);

			switch (size) {
			case SMALL_SIZE:
				field[calcIndex(x - 1, y)] += 1;
				field[calcIndex(x, y + 1)] += 1;
				field[calcIndex(x, y)] += 1;
				field[calcIndex(x, y - 1)] += 1;
				field[calcIndex(x + 1, y)] += 1;
				break;
			case MIDIAM_SIZE:
				field[calcIndex(x - 1, y + 1)] += 1;
				field[calcIndex(x - 1, y)] += 1;
				field[calcIndex(x - 1, y - 1)] += 1;
				field[calcIndex(x, y + 1)] += 1;
				field[calcIndex(x, y)] += 1;
				field[calcIndex(x, y - 1)] += 1;
				field[calcIndex(x + 1, y + 1)] += 1;
				field[calcIndex(x + 1, y)] += 1;
				field[calcIndex(x + 1, y - 1)] += 1;
				break;
			case LARGE_SIZE:
				field[calcIndex(x - 2, y)] += 1;
				field[calcIndex(x - 1, y + 1)] += 1;
				field[calcIndex(x - 1, y)] += 1;
				field[calcIndex(x - 1, y - 1)] += 1;
				field[calcIndex(x, y + 2)] += 1;
				field[calcIndex(x, y + 1)] += 1;
				field[calcIndex(x, y)] += 1;
				field[calcIndex(x, y - 1)] += 1;
				field[calcIndex(x, y - 2)] += 1;
				field[calcIndex(x + 1, y + 1)] += 1;
				field[calcIndex(x + 1, y)] += 1;
				field[calcIndex(x + 1, y - 1)] += 1;
				field[calcIndex(x + 2, y)] += 1;
				break;
			default:
			}
		}

		int count = 0;
		int count1 = 0;
		int max = 0;
		for (int i = 0; i < 100; i++) {
			if (field[i] == 0) {
				count++;
			} else {
				count1++;
			}
			if (field[i] > max) {
				max = field[i];
			}
		}

		System.out.println(count);
		System.out.println(max);
	}

	/**
	 * x座標とy座標を受け取って、配列のインデックスを返却する。
	 *
	 * @param x x座標
	 * @param y y座標
	 * @return 配列のインデックス
	 */
	private static int calcIndex(int x, int y) {
		if (x < 0 || y < 0 || x > 9 || y > 9) {
			return 100;
		}
		return (x * 10) + y;
	}
}

Measured memory_bytes: 16924
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll,ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
int n,h,w,ans;
int main(void){
    cin>>n>>h>>w;
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        if(a>=h&&b>=w)ans++;
    }
    cout<<ans<<endl;
    
}


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

int main() {
  int a, b;
  cin >> a >> b;
  if (a >= 10 || b >= 10) cout << -1 << endl;
  else cout << a * b << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(){
  int a, b;

  cin >> a >> b;

  if (a * b % 2 == 0){
    cout << "Even" << endl;
  } else {
    cout << "Odd" << endl;
  }

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  rep(i,10000){
    int x=i*100;
    int y=i*105;
    if(x<=n&&y>=n){
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 0 << endl;
    
}

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

int main()
{
	string S, T;

	cin >> S >> T;

	int s = S.size(), t = T.size(),ans = 0;
	int a[100], b[100];

	for (int i = 0; i < s; i++) {
		a[i] = S[i] - '0';
	}


	for (int i = 0; i < t; i++) {
		b[i] = T[i] - '0';
	}

	sort(a, a + s);
	sort(b, b + t);
	reverse(b, b + t);

	for (int i = 0; i < s; i++) {
		if (a[i] < b[i]) {
			ans = 1;
			break;
		}
		if (a[i] == b[i]) {
			ans = 2;
		}
		if (a[i] > b[i]) {
			ans = 0;
			break;
		}
	}

	if (ans == 1) {
		cout << "Yes";
	}
	else if (ans == 2 && s < t) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<algorithm>
#include<queue>
#include<list>
#include<stack>
#include<cstdio>
#include<fstream>
#include<numeric>
#include<functional>
#include<utility>
#include<memory>
#include<cstring>
#include<bits/stdc++.h>
using namespace std; 
  
#define CLEAN(a,b) memset(a,b,sizeof(a))
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;

int main() 
{
	int n;
	cin>>n;
	if (n>999) cout<<"ABD"<<endl;
	else cout<<"ABC"<<endl; 
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define mod2 998244353LL
#define INF 1000000000007
 

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> o_tree;


void solve()
{
  ll n;
  cin>>n;
  ll i,j;
  ll a[n];
  for(i=0;i<n;i++)
  {
      cin>>a[i];
  }
  pll dp[n][2];// 0 -all money,1 all stocks
  clr(dp);
  ll res=1000;
  for(i=0;i<n;i++)
  {
    //   dp[i][0]=-1e18;
    //   dp[i][1]=-1e18;
     pll temp ={-1e18,0};
     dp[i][0]=temp;
     dp[i][1]=temp;
  }

  dp[0][0].first=1000;
  dp[0][0].second=0;
  dp[0][1].first=(1000-(1000/a[0])*a[0]);
  dp[0][1].second=(1000/a[0]);
//   cout<<dp[0][1].second<<"\n";

  for(i=1;i<n;i++)
  {
     dp[i][0].first=max({dp[i][1].first,dp[i-1][1].second*a[i]+dp[i-1][1].first,dp[i-1][0].first});
     ll no = dp[i-1][1].second*a[i]+(dp[i-1][1].first);
     ll no2 = dp[i-1][0].first;
     ll maxi = max(no,no2);
     ll tans = maxi-(maxi/a[i])*a[i];

     dp[i][1].first=max({dp[i][1].first,tans});
     dp[i][1].second=max({dp[i][1].second,maxi/a[i]});
  }
  
  for(i=0;i<n;i++)
  {
    //   cout<<dp[i][0].first<<"\n";
      res=max(res,dp[i][0].first);
  }
  cout<<res<<"\n";





}


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


if (fopen("input.txt","r" ))
  {
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
  }
cout<<setprecision(20);


ll t=1;


// cin>>t;


while(t--)
{
solve();
} 


return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
using llong = long long;

llong x;
llong m = 100;

int main() {
    cin >> x;

    llong ans = 0;
    while (m < x) {
        m += m / 100;
        ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3628
# -*- coding: utf-8 -*-
N, A, B = map(int, input().split(' '))
X = list(map(int, input().split(' ')))

diffs = [X[i+1] - X[i] for i in range(N-1)]
ans = 0
for diff in diffs:
    # print(A * diff, B)
    ans += min(A*diff, B)

print (ans)

Measured memory_bytes: 63400
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

ans = ""
n, q = [int(item) for item in input().split()]
if n == 1:
    for i in range(q):
        v, w = [int(item) for item in input().split()]
        print(min(v, w))
    exit()

for i in range(q):
    v, w = [int(item) - 1 for item in input().split()]
    while v != w:
        if v > w:
            v = (v - 1) // n
        else:
            w = (w - 1) // n
    print(v + 1)

Measured memory_bytes: 4192
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int n;
  long long c;
  cin>>n>>c;
  long long x[n],v[n];
  REP(i,n){
    cin>>x[i]>>v[i];
  }
  long long rget[n],lget[n];
  REP(i,n){
    if(i==0){
      rget[i]=v[i]-x[i];
    }else{
      rget[i]=rget[i-1]+v[i]-(x[i]-x[i-1]);
    }
  }
  for(int i=n-1;i>=0;i--){
    if(i==n-1){
      lget[i]=v[i]-(c-x[i]);
    }else{
      lget[i]=lget[i+1]+v[i]-(x[i+1]-x[i]);
    }
  }
  long long ans=0;
  REP(i,n){
    ans = max(ans,rget[i]);
    ans = max(ans,lget[i]);
  }
  
  long long rdget[n],ldget[n];
  REP(i,n){
    rdget[i]=rget[i]-x[i];
    ldget[i]=lget[i]-(c-x[i]);
  }
  long long l=0,r=0;
  REP(i,n){
    if(i>0){
      rdget[i]=max(rdget[i-1],rdget[i]);
    }
  }
  for(int i=n-1;i>=0;i--){
    if(i<n-1){
      ldget[i]=max(ldget[i+1],ldget[i]);
    }
  }
  REP(i,n){
    if(i>0){
      ans = max(ans,ldget[i]+rget[i-1]);
    }
    if(i<n-1){
      ans = max(ans,rdget[i]+lget[i+1]);
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <locale>
using namespace std;
int main(void){
    // Your code here!
    string s1,s2,s3;
    cin >> s1 >> s2 >> s3;
    cout << (char)toupper(s1[0]) << (char)toupper(s2[0]) << (char)toupper(s3[0]) <<endl;
}

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

#define pb push_back
#define fst first
#define snd second
#define fill(a,c) memset(&a, c, sizeof(a))
#define fore(i,x,y) for(ll i=x;i<y;i++)
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

typedef long long ll;
using namespace std;

const int MAXN = 4e5+10;
const ll MOD = 1000000007;
ll arr[MAXN];
int n;

ll sumXOR(){
    ll sum = 0;
    fore(i,0,64){
        ll zc = 0, oc = 0;
        fore(j,0,n){
            if (arr[j] % 2 == 0)
                zc++;
            else
                oc++;
            arr[j] /= 2;
        }

        sum = (sum + ((zc * oc) % MOD * ((1ll << i) % MOD)) % MOD) % MOD;
    }
    return sum;
}

int main() {FIN;
    cin>>n;
    fore(i,0,n) cin>>arr[i];
    cout<<sumXOR()<<"\n";
    return 0;
}



Measured memory_bytes: 2560
a,b,k=map(int,input().split())
dem=1
while dem<=k: 
  if (a%2==0):
    b+=a//2
    a-=a//2
    a,b=b,a
    dem=dem+1
  else:
    a-=1
    b+=a//2
    a-=a//2
    a,b=b,a
    dem=dem+1
if (dem%2==0):
  a,b=b,a
  print(a,b,end="")
else:
  print(a,b,end="")

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#define N 1000050
#define INF (1<<30)

#define gc() getchar()

using namespace std;
int a[N],b[N],n;
inline int rd() {
    int x=0,f=1; char ch=gc();
    while (ch<'0'||ch>'9') ch=='-'?f*=-1:0,ch=gc();
    while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=gc();
    return x*f;
}

int go(int x) {
    for (int i=1;i<=2*n-1;i++) b[i] = a[i] >= x;
    int p = n % 2 == 0 , cur = INF;
    int ret = b[n] ^ p;
    for (int i=n-1;i>=1;i--) {
        if (b[i] == b[i+1] && n-i < cur) {
            cur = n-i;
            ret = b[i];
        } 
    }
    for (int i=n+1;i<=2*n-1;i++) {
        if (b[i] == b[i-1] && i-n < cur) {
            cur = i-n;
            ret = b[i];
        }
    }
    return ret;
}

int main() {
    n = rd();
    for (int i=1;i<=2*n-1;i++) a[i] = rd();
    int l = 1 , r = 2 * n - 1;
    while (l < r) {
        int mid = (l + r + 1) >> 1;
        if (go(mid)) l = mid; else r = mid - 1;
    }
    printf("%d\n",l);
    return 0;
}

Measured memory_bytes: 5248
#include "bits/stdc++.h"

typedef long long ll;
using namespace std;

bool compare_by_second(pair<int, int> a, pair<int, int> b) {
    if (a.second != b.second) {
        return a.second > b.second;
    } else {
        return a.first < b.first;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> odd(n / 2);
    vector<int> even(n / 2);
    for (int i = 0; i < n; ++i) {
        if (i % 2 == 0) cin >> odd[i / 2];
        else cin >> even[i / 2];
    }

    auto first_second = [](vector<int> &v) {
        map<int, int> count_map;
        vector<pair<int, int>> counts;
        for (int e : v) count_map[e]++;
        for (auto p : count_map) counts.emplace_back(p);
        sort(counts.begin(), counts.end(), compare_by_second);

        pair<int, int> first = counts[0];
        pair<int, int> second = 1 < counts.size() ? counts[1] : make_pair(0, 0);
        return make_pair(first, second);
    };

    auto odd_pair = first_second(odd);
    auto even_pair = first_second(even);

    auto o1 = odd_pair.first;
    auto o2 = odd_pair.second;
    auto e1 = even_pair.first;
    auto e2 = even_pair.second;

    if (o1.first != e1.first) {
        cout << n - o1.second - e1.second;
    } else {
        cout << n - max(o1.second + e2.second, o2.second + e1.second);
    }

    return 0;
}


Measured memory_bytes: 3828
import java.util.*;
import java.io.*;
 
public class Main {
    static boolean[][] used;
    static int[] ans;
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        out.println(sc.nextInt()*sc.nextInt());
        out.close();
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}

Measured memory_bytes: 25392
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
using LP=pair<ll,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    string S;
    cin>>S;
    int N=sz(S)+1;
    vector<int> A(N,-1);
    if(S.at(0)=='<')A.at(0)=0;
    if(S.at(N-2)=='>')A.at(N-1)=0;
    rep(i,N-2){
        if(S.at(i)=='>' && S.at(i+1)=='<'){
            A.at(i+1)=0;
        }
    }
    rep(i,N){
        if(A.at(i)!=0)continue;
        int pl=i-1,pr=i;
        while(pl>=0 && S.at(pl)=='>'){
            chmax(A.at(pl),A.at(pl+1)+1);
            pl--;
        }
        while(pr<N-1 && S.at(pr)=='<'){
            chmax(A.at(pr+1),A.at(pr)+1);
            pr++;
        }
    }
    ll ans=0;
    rep(i,N)ans+=A.at(i);
    cout<<ans<<endl;
}

Measured memory_bytes: 5804
#include "bits/stdc++.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define reset(a,b) memset(a,b,sizeof a);
#define ALL(x) x.begin(),x.end()
 
template <typename T>
void cetak(T t){cout << t << ')' << endl;}
template <typename T, typename... V>
void cetak(T t, V... v) {cout << t; if (sizeof...(v)) cout << ", "; cetak(v...);}
 
#define debug(x...) cout << '(' << #x << ") = ("; cetak(x) 
#define sz(x) (int)(x.size())
#define lt(x) (int)(x.length())


const int MOD = 1e9 + 7;

int add(int x, int y){
    int ret = x + y;
    if(ret >= MOD) ret -= MOD;
    return ret;
}
int sub(int x, int y){
    int ret = x - y;
    if(ret < 0) ret += MOD;
    return ret;
}
int mul(int x, int y){
    return (long long)x * y % MOD;
}


const int mx = 2e5 + 10;

int n, sz[mx];
vector<int> g[mx];

int POW(int a, int b){
    int ret = 1;
    while(b > 0){
        if(b & 1) ret = mul(ret, a);
        b >>= 1;
        a = mul(a, a);
    }
    return ret;
}

int ans;

void dfs(int now, int par){
    sz[now] = 1;
    for(int i : g[now]){
        if(i != par){
            dfs(i, now);
            sz[now] += sz[i];
        }
    }
    vector<int> subtree;
    int gak_masuk = 1; // semua nya putih
    if(n - sz[now] > 0) subtree.pb(n - sz[now]);
    for(int i : g[now]){
        if(i != par) subtree.pb(sz[i]);
    }
    for(int i : subtree){
        int hitam = sub(POW(2, i), 1);
        gak_masuk = add(gak_masuk, hitam);
    }
    int total = POW(2, n - 1);
    total = sub(total, gak_masuk);
    ans = add(ans, total);
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for(int i = 1; i < n; i++){
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    dfs(1, 0);
    ans = mul(ans, POW(POW(2, n), MOD - 2));
    cout << ans << endl;
}

Measured memory_bytes: 29824
using System;

namespace abc095_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int ret = 700;
            for (int i = 0; i < 3; i++) if (s[i] == 'o') ret += 100;
            Console.WriteLine(ret);
        }
    }
}


Measured memory_bytes: 11092
import java.util.Scanner;

public class Main{
public static void main(String[] args) {

 Scanner sc = new Scanner(System.in);
   String line = sc.nextLine();
   int length = line.length();
   for(int i =0; i< length; i++){
   char ch = line.charAt(i);
   if (Character.isLowerCase(ch)) {
    System.out.print(Character.toUpperCase(ch));
   }
   else
   {
       if(Character.isUpperCase(ch)){
        System.out.print(Character.toLowerCase(ch));
    
       }
          
   else{
        System.out.printf("%s",ch);
   }
}
   }
   System.out.printf("\n");
}
}



  

   


Measured memory_bytes: 26848
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int h;
int n;

int main() {
    fastio();

    cin >> h >> n;
    int total = 0;
    forn(i, n) {
        int a;
        cin >> a;
        total += a;
    }

    if (total >= h) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define endl '\n'
#define Endl '\n'
#define fi first
#define ii pair<int,int>
#define iil pair<ll,ll>
#define iii pair<pair<int, int>, int >
#define iiil pair<pair<ll, ll>, ll >
#define se second
#define ld long double
#define mod 1000000007
#define popcount __builtin_popcountll
#define x0 zxcxzcsacasd
#define x1 ghfghujfgfg
#define y0 olkjhdnncvcv
#define y1 bhvgrewm345345435
using namespace std;
multiset<ll>ms[5];
void add(ll x, ll y){
    ms[1].insert(x + y);
    ms[2].insert(-x + y);
    ms[3].insert(-x - y);
    ms[4].insert(x - y);
}
void del(ll x, ll y){
    ms[1].erase(ms[1].find(x + y));
    ms[2].erase(ms[2].find(-x + y));
    ms[3].erase(ms[3].find(-x - y));
    ms[4].erase(ms[4].find(x - y));
}
ll query(ll x, ll y){
    if(ms[1].empty())return -1;
    ll ret = 0;
    ret = max(ret, *ms[1].rbegin() + (-x - y));
    ret = max(ret, *ms[2].rbegin() + (x - y));
    ret = max(ret, *ms[3].rbegin() + (x + y));
    ret = max(ret, *ms[4].rbegin() + (-x + y));
    return ret;
}
ll a[1<<20];
ll b[1<<20];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%lld%lld", &a[i], &b[i]);
		add(a[i], b[i]);
	}
	ll amid = 0;
	for(int i=0;i<n;i++){
		del(a[i], b[i]);
		amid = max(amid, query(a[i], b[i]));
		add(a[i], b[i]);
	}
	cout<<amid<<endl;
}


Measured memory_bytes: 44384
#include <bits/stdc++.h>
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    ll N,ss[4];
    memset(ss,0,sizeof(ss));
    string S;
    cin >> N;
    REP(i,N){
        cin >> S;
        if(S=="AC"){
            ss[0]++;
        }else if(S=="WA"){
            ss[1]++;
        }else if(S=="TLE"){
            ss[2]++;
        }else if(S=="RE"){
            ss[3]++;
        }
    }
    cout << "AC x " << ss[0] << endl;
    cout << "WA x " << ss[1] << endl;
    cout << "TLE x " << ss[2] << endl;
    cout << "RE x " << ss[3] << endl;

    return 0;  
}


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

int a[200010];
long long dp[200010][5];

int main(){
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++){
		scanf("%d", &a[i]);
	}
	for (int i = 1; i <= n; i++){
		dp[i][0] = dp[i - 1][0] + a[i];
	}
	for (int i = 1; i <= n; i++){
		dp[i][1] = min(dp[i - 1][1] + (!a[i] ? 2 : a[i] % 2 == 1), dp[i][0]);
	}
	for (int i = 1; i <= n; i++){
		dp[i][2] = min(dp[i - 1][2] + (!a[i] ? 1 : a[i] % 2 == 0), dp[i][1]);
	}
	for (int i = 1; i <= n; i++){
		dp[i][3] = min(dp[i - 1][3] + (!a[i] ? 2 : a[i] % 2 == 1), dp[i][2]);
	}
	for (int i = 1; i <= n; i++){
		dp[i][4] = min(dp[i - 1][4] + a[i], dp[i][3]);
	}
	printf("%lld\n", dp[n][4]);
	return 0;
}


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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
int inf = 1e9;
Int mod = 1e9+7;

int main() {
    Int n;
    cin >> n;
    vector<Int> x(n), y(n), h(n);
    for (Int i = 0; i < n; i++) {
        cin >> x[i] >> y[i] >> h[i];
    }
    for (Int i = 0; i <= 100; i++) {
        for (Int j = 0; j <= 100; j++) {
            Int tmp_h = -1;
            for (Int k = 0; k < n; k++) {
                if (h[k] > 0) {
                    tmp_h = h[k] + abs(y[k] - i) + abs(x[k] - j);
                    break;
                }
            }
            bool check = true;
            for (Int k = 0; k < n; k++) {
                if (h[k] != max(tmp_h - abs(y[k] - i) - abs(x[k] - j), (Int)0)) {
                    check = false;
                }
            }
            if (check) {
                cout << j << " " << i << " " << tmp_h << endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
N = int(input())
A = [0] + list(map(int, input().split())) + [0]
S = sum(abs(A[i]-A[i+1]) for i in range(len(A)-1))
for i in range(1, N+1):
    print(S-(abs(A[i]-A[i+1]) + abs(A[i]-A[i-1]))+abs(A[i+1]-A[i-1]))


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

int main() {
    string s, t;
    cin >> s >> t;

    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());

    if(s < t) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 5LL << 60;
const ll mod = 1e9 + 7;

bool isOK(int index, int key, vector<int>& a) {
	if(a[index] >= key)
		return true;
	else
		return false;
}

ll binary_search(int key, vector<int>& a) {
	ll ng = -1;				//「index = 0」が条件を満たすこともあるので、初期値は -1
	ll ok = (int)a.size();	// 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

	/* ok と ng のどちらが大きいかわからないことを考慮 */
	while(abs(ok - ng) > 1) {
		int mid = (ok + ng) / 2;

		if(isOK(mid, key, a))
			ok = mid;
		else
			ng = mid;
	}
	return ok;
}

int main() {
	int N;
	cin >> N;
	vector<int> a(N), b(N), c(N);
	for(int i = 0; i < N; i++) cin >> a[i];
	for(int i = 0; i < N; i++) cin >> b[i];
	for(int i = 0; i < N; i++) cin >> c[i];
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	ll ans = 0;
	for(int i = 0; i < N; i++) ans += binary_search(b[i], a) * (N - binary_search(b[i] + 1, c));
	cout << ans;
	return 0;
}


Measured memory_bytes: 4576
#include<cstdio>
#include<cmath>
bool isPrime(int n){
    if(n == 2) return true;
    if(n < 2 || n%2==0) return false;
    for(int i = 3; i <= sqrt(n); i+=2){
        if(n%i == 0) return false;
    }
    return true;
}

int main(){
  int n; scanf("%d", &n);
  int j=11;
  for(int i=0;i<n;i++){
    if(isPrime(j)) printf("%d ", j);
    else i--;
    j+=10;
  }
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		sc.close();

		if (d == 25) {
			System.out.println("Christmas");
		} else if (d == 24) {
			System.out.println("Christmas Eve");
		} else if (d == 23) {
			System.out.println("Christmas Eve Eve");
		} else if (d == 22) {
			System.out.println("Christmas Eve Eve Eve");
		}
	}
}


Measured memory_bytes: 21204
#include "bits/stdc++.h"
#ifndef err
#define err(...)(void)0
#endif
using namespace std;
using ll = long long;
using ull = decltype(1ull);
template<class T>int size(T&&a) { return a.size(); }
#define REP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.first,_l##t=a.second;t<_l##t;t++)
#define RREP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.second-1,_l##t=a.first;t>=_l##t;t--)
template<class B>pair<int, B>make_pair(B b) { return{ 0,b }; }
#define rep(t,...)REP(t,make_pair(__VA_ARGS__))
#define rrep(t,...)RREP(t,make_pair(__VA_ARGS__))
#define all(a)begin(a),end(a)
#define rall(a)a.rbegin(),a.rend()
#define var(t, ...) t __VA_ARGS__;in,__VA_ARGS__;

void Calc();
int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr);
  cin.exceptions(istream::failbit | istream::badbit);
  cout << fixed << setprecision(15); Calc(); cout.flush(); return 0;
}
template<class A>void amax(A&a, A b) { a = max(a, b); }
template<class A>void amin(A&a, A b) { a = min(a, b); }
template<class A>int comp(A a, A b) { return a < b ? 1 : b < a ? -1 : 0; }
struct Scanner {
  template<class A = string>A Next() { A a; cin >> a; return a; }
  template<class A = int>vector<A>Array(int n) { vector<A>a(n); for (A&i : a) cin >> i; return a; }
  string Line() const { string s; getline(cin, s); return s; }
  template<class A>Scanner&operator,(A&a) { a = Next<A>(); return *this; }
  template<class A>operator A() { return Next<A>(); }
}in;

/*---------------------------------------------------------------------*/

void Calc() {
  var(ll, n, a, b);
  if (b < a) {
    cout << (0) << endl;
  }
  else if (n == 1) {
    cout << (b == a) << endl;
  }
  else if (n == 2) {
    cout << (1) << endl;
  }
  else {
    cout << (b * (n - 2) - a*(n - 2)) + 1 << endl;
  }
}


Measured memory_bytes: 256
#include<bitset>
#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<sstream>
#include<list>
#include<queue>
#include<algorithm>
#include<functional>
#include<map>
#include<set>
#include<utility>
#include<initializer_list>
#include<tuple>
#include<regex>
using namespace std;
#define ull unsigned long long
#define ll long long
#define rep(i, a, n) for(int i=(a);i<(int)(n);i++)
#define repc(i, a, n) for(int i=(a);i<=(int)(n);i++)
#define all(t) t.begin(), t.end()
#define rall(t) t.rbegin(), t.rend()
#define mat(type, row, col, init) vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout<<(cond? "Yes":"No")<<endl;
#define YES(cond) cout<<(cond? "YES":"NO")<<endl;
int main() {
	int n, d, x;
	cin >> n >> d >> x;
	vector<int>a(n);
	rep(i, 0, n)cin >> a[i];
	int sum = x;
	rep(i, 0, n) {
		sum += (d-1) / a[i] + 1;
	}
	cout << sum;


	return 0;
}





Measured memory_bytes: 256
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;
use std::iter::FromIterator;
use std::collections::BinaryHeap;

fn main() {
    let cin = stdin();
    let mut scan = Scanner::new(cin.lock());
    let mut w = scan.read::<usize>();
    let mut h = scan.read::<usize>();
    let p = scan.readn::<i64>(w);
    let q = scan.readn::<i64>(h);
    let mut heap = BinaryHeap::new();
    for i in 0..w {
        heap.push((Rev(p[i]), true));
    }
    for i in 0..h {
        heap.push((Rev(q[i]), false));
    }
    w += 1;
    h += 1;
    let mut ret = 0;
    while let Some((Rev(t), b)) = heap.pop() {
        if b {
            ret += t * h as i64;
            w -= 1;
        } else {
            ret += t * w as i64;
            h -= 1;
        }
    }
    println!("{}", ret);
}

#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<std::cmp::Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> std::cmp::Ordering {
        other.0.cmp(&self.0)
    }
}

// region template
#[allow(dead_code)]
fn iu(i: isize) -> usize { i as usize }

#[allow(dead_code)]
fn ui(i: usize) -> isize { i as isize }

#[allow(dead_code, deprecated)]
fn join<T: std::fmt::Display>(slice: &[T], sep: &str) -> String {
    let strings = slice.iter().map(|t| format!("{}", t)).collect::<Vec<_>>();
    strings.connect(sep)
}

#[allow(dead_code)]
fn arr<'a, S, T>(n: usize, mut f: S) -> Vec<T> where S: FnMut(usize) -> T + 'a {
    (0..n).map(|i| f(i)).collect::<Vec<T>>()
}

#[allow(dead_code)]
fn alt<S, T>(v: Vec<S>) -> T where T: FromIterator<S> {
    v.into_iter().collect::<T>()
}

#[allow(dead_code)]
fn dup<S, T>(v: &[S]) -> T where T: FromIterator<S>, S: Clone {
    v.iter().cloned().collect::<T>()
}

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }

    fn readn<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect()
    }

    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
// endregion

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

using namespace std;

#define U unsigned
#define S short
#define L long
#define LL long long 
#define LLU long long unsigned

//Reading and Printing Arrays

//short int
#define rhd(arr, n) for(int aab = 0; aab < n; aab++){scanf("%hd", &arr[aab]);}
#define phd(arr, n) for(int aab = 0; aab < n; aab++){printf("%hd ", arr[aab]);}
//int
#define rd(arr, n) for(int aab = 0; aab < n; aab++){scanf("%d", &arr[aab]);}
#define pd(arr, n) for(int aab = 0; aab < n; aab++){printf("%d ", arr[aab]);}
//unsigned int
#define ru(arr, n) for(int aab = 0; aab < n; aab++){scanf("%u", &arr[aab]);}
#define pu(arr, n) for(int aab = 0; aab < n; aab++){printf("%u ", arr[aab]);}
//long int
#define rld(arr, n) for(int aab = 0; aab < n; aab++){scanf("%ld", &arr[aab]);}
#define pld(arr, n) for(int aab = 0; aab < n; aab++){printf("%ld ", arr[aab]);}
//unsigned long int
#define rlu(arr, n) for(int aab = 0; aab < n; aab++){scanf("%lu", &arr[aab]);}
#define plu(arr, n) for(int aab = 0; aab < n; aab++){printf("%lu ", arr[aab]);}
//long long int
#define rlld(arr, n) for(int aab = 0; aab < n; aab++){scanf("%lld", &arr[aab]);}
#define plld(arr, n) for(int aab = 0; aab < n; aab++){printf("%lld ", arr[aab]);}
//unsigned long long int
#define rllu(arr, n) for(int aab = 0; aab < n; aab++){scanf("%llu", &arr[aab]);}
#define pllu(arr, n) for(int aab = 0; aab < n; aab++){printf("%llu ", arr[aab]);}
//float
#define rf(arr, n) for(int aab = 0; aab < n; aab++){scanf("%f", &arr[aab]);}
#define pf(arr, n) for(int aab = 0; aab < n; aab++){printf("%f ", arr[aab]);}
//double
#define rlf(arr, n) for(int aab = 0; aab < n; aab++){scanf("%lf", &arr[aab]);}
#define plf(arr, n) for(int aab = 0; aab < n; aab++){printf("%lf ", arr[aab]);}
//char
#define rc(arr, n) for(int aab = 0; aab < n; aab++){scanf("%c", &arr[aab]);}
#define pc(arr, n) for(int aab = 0; aab < n; aab++){printf("%c", arr[aab]);}
//string
#define rs(arr) scanf("%s", arr);
#define ps(arr) puts(arr);

//swap
#define swap(a, b, tip) tip tempswap = a;a = b;b = tempswap;
//freopen
#define freopen freopen("in.txt", "r", stdin);freopen("out.txt", "w", stdout);

/*       ▄▀▄     ▄▀▄
        ▄█░░▀▀▀▀▀░░█▄
    ▄▄  █░░░░░░░░░░░█  ▄▄
   █▄▄█ █░░▀░░┬░░▀░░█ █▄▄█       */

int min(int a, int b){	return a <= b ? a : b;}
int max(int a, int b){	return a >= b ? a : b;}
int findmin(int arr[], int n){int min = 0;for(int i = 1; i < n;min = arr[i] < arr[min] ? i : min, i++);return min;}
int findmax(int arr[], int n){int max = 0;for(int i = 1; i < n;max = arr[i] > arr[max] ? i : max, i++);return max;}
int arrsum(int arr[], int n){int sum = 0;for(int i = 0; i < n; sum += arr[i], i++);return sum;}
	
int main(){
	int arr[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

	int a;

	scanf("%d", &a),

	printf("%d", arr[a - 1]);
}

Measured memory_bytes: 128
from itertools import permutations

def main():
    N, M, R = map(int, input().split())
    r = list(map(int, input().split()))
    d = [[float('inf')] * N for _ in range(N)]
    for _ in range(M):
        A, B, C = map(int, input().split())
        A -= 1
        B -= 1
        d[A][B] = C
        d[B][A] = C
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])

    ans = float('inf')
    for D in list(permutations(r)):
        tmp = 0
        for i in range(len(D)-1):
            tmp += d[D[i]-1][D[i+1]-1]
        ans = min(ans, tmp)

    print(ans)



           



if __name__ == "__main__":
    main()

Measured memory_bytes: 66904
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int a,b; cin >> a >> b;
    int ans = 0;
    for (int k = a; k <= b; k++)
    {
        int d = k;
        vector<int> digit(0);
        while (d > 0) {
            digit.push_back(d%10);
            d /= 10;
        }
        int size = digit.size();
        //rep(i,size) cout << digit[i];
        //cout << endl;
        bool ok = true;
        for (int i = 0; i < size/2; i++)
        {
            if (digit[i] != digit[size-1-i])
            {
                ok = false; break;
            }
        }
        if (ok)
        {
            ans++;
        }
        
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	boolean J = true;
	  	int a = 0;
	  	
	  	while(J) {
	  		
		  	int  x = scanner.nextInt();			//入力
		  	String s = scanner.next();
		  	int  y = scanner.nextInt();
	  		
		  	switch(s){
		  	case "+":
		  		System.out.println(x + y);
		  		break;
		  	case "-":
		  		System.out.println(x - y);
		  		break;
		  	case "*":
		  		System.out.println(x * y);
		  		break;
		  	case "/":
		  		System.out.println(x / y);
		  		break;
		  	case "?":
		  		a = 1;
			  	break;
			default:
			  	break;
		  	}

		  	if(a == 1)
		  		break;
		  	
  		}
        scanner.close();
  }
}


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

int dp[50];
int main() {
	dp[0] = 1;
	for (int i = 1; i <= 30; i++) {
		dp[i] += dp[i - 1];
		if (i >= 2)dp[i] += dp[i - 2];
		if (i >= 3)dp[i] += dp[i - 3];
	}
	int n;
	while (cin >> n, n) {
		cout << ceil(dp[n] / 10. / 365.) << endl;
	}
}

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

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const double eps = 1e-9;

typedef pair<ll, ll> P;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int limit = 50;

int n, m;
int a[limit], b[limit];
bool graph[limit][limit];
bool visited[limit];

void dfs(int now) {
    visited[now] = true;
    for (int i = 0; i < m; i++) {
        if (!graph[now][i]) continue;
        if (visited[i]) continue;
        dfs(i);
    }
}


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

    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }

    int ans = 0;

    for (int i = 0; i < m; i++) {
        for (int j = 0; j < m; j++) visited[j] = false;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;

        dfs(0);

        bool tmp = true;
        for (int i = 0; i < n; i++) {
            if (!visited[i]) {
                tmp = false;
                break;
            }
        }

        if (!tmp) ans++;

        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int main () {
  long A,B,K;
  cin >> A>> B>> K;
  for(int i = 0; i < K; i++){
    if(i % 2 == 0){
      if(A % 2 == 1){
        A--;
      }
      B += A / 2;
      A /= 2;
    }else{
      if(B % 2 == 1){
        B--;
      }
      A += B / 2;
      B /= 2;
    }
  }
  cout << A << " " << B << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
 
#define NMAX 1000000

using namespace std;
  
int main(void){

    std::ios_base::sync_with_stdio(false);
    set<string> disc;
    string iof,str;
    int n;

    cin>>n;
 
    while(n--){
        cin>>iof>>str;
        if(iof[0]=='i') disc.insert(str);
        else{
			if(disc.find(str)!=disc.end()) cout<<"yes"<<endl;
			else cout<<"no"<<endl;
        }
    }
 
    return 0;
}

Measured memory_bytes: 27808
#include <bits/stdc++.h>
using namespace std;
#define repr(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;
#define mod 1000000007

ll gcd(ll x,ll y) {return y ? gcd(y,x%y) : x;} 
ll lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main(){
    ll n;
    cin >> n;
    vector<ll> vec(n,0);
    rep(i,n){
        int a,b;
        cin >> a >> b;
        if(a==b) vec[i]=1;
    }
    for(ll i=0;i<n-2;i++){
        if(vec[i]+vec[i+1]+vec[i+2]==3){
            cout << "Yes" << endl;
            return 0;
        }
    }
    
    cout << "No" << endl;

    return 0;
}











Measured memory_bytes: 3628
#include <iostream>
#include <list>

using namespace std;

int main()
{
	list<int> V;
	
	int n = 3;
	while (n--)
	{
		int x;
		cin >> x;
		V.push_front(x);
	}
	
	V.sort();
	cout << V.front() << ' ' << V.back() << endl;
} 


Measured memory_bytes: 3100
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
int BinarySearch(int key,int n,int S[]){
  int l=0,r=n;
  while(r-l>1){
    int mid=(l+r)/2;
    if(S[mid]>key)r=mid;
    else l=mid;
  }
  return S[l]==(key?1:0);
}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
  ll N,T,c[109],t[109],k=MOD;
  cin >> N >> T;
  rep(i,N){
    cin >> c[i] >> t[i];
    if(t[i]<=T && c[i]<k){
      k=c[i];
    }
  }
  if(k==MOD){
    cout << "TLE" << endl;
    return 0;
  }
  cout << k << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define MAX 10000
#define MIN -1

  
int Height(int);
int Sibling(int);
void Depth(int,int);
void Print(int);
  
typedef struct {
  int p,l,r;
}Node;
  
Node node[MAX];
  
int n, height[MAX], depth[MAX];
  
int main(){
  int i;
  int id, l, r, root = 0;
  
  scanf("%d",&n);
  
  for( i = 0 ; i < n ; i++ ) {
    node[i].p = MIN;
  }
  
  for( i = 0 ; i < n ; i++ ) {
    scanf("%d%d%d",&id,&l,&r);
    
    node[id].l = l;
    node[id].r = r;
    if(l != MIN) node[l].p = id;
    if(r != MIN) node[r].p = id;
  }
  
  for( i=0 ; i<n ; i++) {
    if( node[i].p == MIN ) {
      root = i;
    }
  }
  
  Depth(root,0);
  Height(root);
  
  i = 0;
  while( i < n ){
    Print(i);
    i++;
  }
  
  return 0;
}

int Height(int u) {
  int h1 = 0 , h2 = 0;
  
  if(node[u].l != MIN) {
    h1 = Height(node[u].l) + 1;
  }
  if(node[u].r != MIN) {
    h2 = Height(node[u].r) + 1;
  }
  
  if(h1 > h2) return height[u] = h1;
  else return height[u] = h2;
}
  
int Sibling(int u) {
  if(node[u].p == MIN) return MIN;
  if( node[node[u].p].r != u && node[node[u].p].r != MIN ) return node[node[u].p].r;
  if( node[node[u].p].l != u && node[node[u].p].l != MIN ) return node[node[u].p].l;
  
  return MIN;
}
  
void Depth( int u, int d ) {
  if(u == MIN) return;
  depth[u] = d;
  Depth(node[u].l, d+1);
  Depth(node[u].r, d+1);
}
  
void Print(int u) {
  int suu = 0;
  
  printf("node %d: parent = %d, sibling = %d, ",u,node[u].p,Sibling(u));
  if(node[u].l != MIN) suu++;
  if(node[u].r != MIN) suu++;
  
  printf("degree = %d, depth = %d, height = %d, ",suu,depth[u],height[u]);
  if(node[u].p == MIN) printf("root\n");
  else if( node[u].l == MIN && node[u].r == MIN ) printf("leaf\n");
  else printf("internal node\n");
} 

Measured memory_bytes: 620
#include <bits/stdc++.h>
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e5;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;
string S;
int K;

itn memo[333][333][333];
itn f(itn l, int r, int k) {
    if (memo[l][r][k] != 0)
        return memo[l][r][k];
    if (k < 0)
        return INF * -1;
    if (l == r)
        return 1;
    if (l == r + 1)
        return 0;
    if (l > r)
        return INF * -1;
    int ret = 0;
    chmax(ret, f(l + 1, r, k));
    chmax(ret, f(l, r - 1, k));
    if (S[l] == S[r])
        chmax(ret, f(l + 1, r - 1, k) + 2);
    else
        chmax(ret, f(l + 1, r - 1, k - 1) + 2);
    //cerr << l + 1 << " " << r + 1 << " " << k << " " << ret << endl;
    memo[l][r][k] = ret;
    return ret;
}

void solve() {
    itn N = S.size();
    cout << f(0, N - 1, K) << endl;
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> S >> K;
    solve();
    return 0;
}


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

const int mx = 1e5+5 ;
LL dp[mx] ;

int main(){

	int N, W, w, v ;
	cin >> N >> W ;

	for(int i = 0 ; i < N ; i++){
		cin >> w >> v ;
		for(int j = W ; j >= w ; j--){
			dp[j] = max(dp[j], dp[j-w] + v) ;
		}
	}

	LL ans = dp[0] ;
	for(int i = 1 ; i <= W ; i++)
		ans = max(ans, dp[i]) ;
	cout << ans << endl ;

	return 0;
}

Measured memory_bytes: 1024