akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;


int main(){
	fast_io();
	int n,q;
	cin >> n >> q;
	vector<pair<int,pii>> blocks(n);
	cu(i,0,n){cin >> blocks[i].S.F >> blocks[i].S.S >> blocks[i].F;}
	sort(all(blocks));

	set<pii> people;
	cu(i,0,q){
		int d;
		cin >> d;
		people.insert({d,i});
	}

	vector<int> ans(q);
	cu(i,0,n){
		auto l = people.lower_bound({blocks[i].S.F - blocks[i].F,0});
		auto r = people.lower_bound({blocks[i].S.S - blocks[i].F,0});
		auto ind = l;
		while(ind != r){
			ans[ind->S] = blocks[i].F;
			++ind;
		}
		people.erase(l,r);
	}
	for(auto p:people){
		ans[p.S] = -1;
	}
	cu(i,0,q){
		cout << ans[i] << '\n';
	}
}


Measured memory_bytes: 14464
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, K, X, Y;
  cin >> N >> K >> X >> Y;
  int sum = 0;
  for(int i=1; i<=N; i++){
    if(i<=K){
      sum += X;
    }
    else{
      sum += Y;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
 
int main() {
  int n, m;
  cin >> n >> m;
  map<int, string> results;
  map<int, int> count;
  rep(i, m) {
    int a;
    cin >> a;
    string s;
    cin >> s;
    if(results.count(a)) {
      if(results.at(a) != "AC") {
        results[a] = s;
        count[a]++;
      }
    }
    else {
      results[a] = s;
      count[a] = 1;
    }
  }
  int ac = 0;
  for(auto p : results) {
    auto key = p.first;
    auto value = p.second;
    if(results.at(key) == "AC") ac++;
  }
  int pena = 0;
  for(auto p : count) {
    auto key = p.first;
    auto value = p.second;
    if(results.at(key) == "AC") (pena += p.second - 1);
  }
  cout << ac << " " << pena << endl;
}

Measured memory_bytes: 15872
#include <iostream>
#include <cassert>
#include <vector>
#include <algorithm>

using namespace std;


class UnionFind {
  public:
    UnionFind() : _n{0}{}
    UnionFind(int n) : _n{n}, pr(n, -1){}

    int merge(int a, int b) {
      assert(0 <= a && a < _n);
      assert(0 <= b && b < _n);
      a = leader(a);
      b = leader(b);
      if (a == b) return a;
      if (-pr[a] < -pr[b]) swap(a, b);
      pr[a] += pr[b];
      pr[b] = a;
      return a;
    }

    bool same(int a, int b) {
      assert(0 <= a && a < _n);
      assert(0 <= b && b < _n);
      return leader(a) == leader(b);
    }

    int leader(int a) {
      assert(0 <= a && a < _n);
      return (pr[a]<0) ? a : (pr[a]=leader(pr[a]));
    }

  private:
    int _n;
    vector<int> pr;
};

int main() {
  int N, Q;
  cin >> N >> Q;
  UnionFind U{N};
  while (Q--) {
    int t, u, v;
    cin >> t >> u >> v;
    if (!t) {
      U.merge(u, v);
    } else {
      cout << U.same(u, v) << endl;
    }
  }
  return 0;
}


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

#define ll unsigned long long
#define pb push_back
int main()
{
    char c[5][5];
    for(int i = 0; i < 3 ; i++)
        for(int j = 0; j < 3 ; j++)
            cin >> c[i][j];
    cout << c[0][0] << c[1][1] << c[2][2];
    return 0;
}


Measured memory_bytes: 3552
#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

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


using namespace std;



int main() {
	
	
	int n;
	cin >> n;
	map<string, int>x;
	map<string, bool>p;
	vector<string>a(n);
	long long int ans = 0;
	for (int i = 0; i < n; i++) {
	
		cin >> a[i];
		sort(a[i].begin(), a[i].end());
		ans += x[a[i]];
		x[a[i]]++;
		
	}
	/*
	for (int i = 0; i < n; i++) {
		if (p[a[i]])continue;
		p[a[i]] = 1;
		ans += (x[a[i]] - 1)*(x[a[i]]) / 2;
	}
	*/

	cout << ans << endl;


	return 0;


}

Measured memory_bytes: 18176
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
    int n;cin >> n;
    vector<int> a(n);
    rep(i,n)cin >> a[i];
    map<int,int> cnt;
    rep(i,n)cnt[a[i]]++;
    // trace(cnt);
    int odd = 0,even = 0;
    for(auto p:cnt){
        if(p.second%2)odd++;
        else even++;
    }
    int ret = 0;
    ret += odd;
    ret += even/2*2;
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 10388
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		double ch = Math.log(N)/Math.log(K);
		int ans = (int)Math.ceil(ch);
		if(ans == ch) {
			System.out.println(ans+1);
		}else{
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 22612
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  ll N, A, B;
  cin>>N>>A>>B;
  ll h[N];
  for(int i=0;i<N;++i) cin>>h[i];
  ll maxh = 0;
  for(int i=0;i<N;++i) maxh = max(maxh, h[i]);
  ll l=0, r=maxh/B+1, m;
  ll tmp;
  while(l<r) {
    m = (l+r)/2;
    tmp = 0;
    for(int i=0;i<N;++i) {
      if(h[i]-B*m<=0) continue;
      if((h[i]-B*m)%(A-B)==0) tmp += (h[i]-B*m)/(A-B);
      else tmp += (h[i]-B*m)/(A-B)+1;
    }
    if(tmp<=m) r = m;
    else l = m+1;
  }
  cout<<l<<endl;
}



Measured memory_bytes: 4352
#include<stdio.h>
int main(void){
   int a,b,c;
   scanf("%d%d%d",&a,&b,&c);
   if(1<=a<=100&&1<=b<=100&&1<=c<=100){
       if(a<b&&b<c&&a<c){
             printf("Yes\n");
         }
        else{
             printf("No\n");
         }
   }
   return 0;
}


Measured memory_bytes: 2040
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<sstream>
#include<map>
#include<cmath>
using namespace std;
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1;i <=n;i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
#define ALL(a) a.begin(),a.end()
typedef long long ll;
typedef long double ld;
const ll MOD =  1000000007;
const ll INF =  1LL << 60;
ll n, m, x, y,z,w,h, sum= 1, ans = 0;
int main() {
    string s; cin >> s >> m;
    rep(i, s.size()) {
        if (s[i] == 'a') continue;
        x = 'z' - s[i] + 1;
        if (x <= m) {
            m -= x;
            s[i] = 'a';
        }
    }if (m == 0) {
        cout << s << endl;
        return 0;
    }
    m %= 26;
    char c = (s.back() + m);
    s[s.size() - 1] = c;
    cout << s << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<string>

using namespace std;

int main(void){
  int num;
  string S,T;
  char S1,T1;
  cin >> S >> T;
  for(int i=0;i<3;i++){
    char S1= S[i];
    char T1= T[i];
    if(S1==T1){
      num++;
    }
  }
  cout << num << endl;
}

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

//RMQ
struct SegmentTree{
private:
	int N;
	vector<long long> node, lazy;
	vector<bool> lazyFlg;
	const long long DEFAULT = 9223372036854775807LL;
public:
	void init(int n){ //初期化 O(N)
		node.clear();
		lazy.clear();
		lazyFlg.clear();
		N = 1;
		while(N < n) N = (N<<1);
		for(int i=0; i<2*N-1; i++){
			node.push_back(DEFAULT);
			lazy.push_back(0LL);
			lazyFlg.push_back(false);
		}
	}
	void eval(int k, int l, int r){ //遅延評価 O(1)
		if(lazyFlg[k]){ //RUQ：下に更新クエリが溜まっていても加算クエリが溜まっていても上書き
			node[k] = lazy[k];
			if(r-l > 1){
				lazy[2*k+1] = lazy[k];
				lazyFlg[2*k+1] = true;
				lazy[2*k+2] = lazy[k];
				lazyFlg[2*k+2] = true;
			}
			lazy[k] = 0LL;
			lazyFlg[k] = false;
		}
		else{ //RAQ：下に更新クエリが溜まっていても加算クエリが溜まっていても加算
			node[k] += lazy[k];
			if(r-l > 1){
				lazy[2*k+1] += lazy[k];
				lazy[2*k+2] += lazy[k];
			}
			lazy[k] = 0LL;
		}
	}
	void update(int a, long long x){ //[a,a+1)の値を変更 O(log N)
		update(a, a+1, x);
	}
	void update(int a, int b, long long x, int k=0, int l=0, int r=-1){ //[a,b)の値を変更 O(log N)
		if(r == -1) r = N;
		eval(k, l, r);
		if(b <= l || r <= a) return; //交差する場合
		if(a <= l && r <= b){ //完全に含む場合
			lazy[k] = x;
			lazyFlg[k] = true;
			eval(k, l, r);
		}
		else{
			update(a, b, x, 2*k+1, l, (l+r)/2);
			update(a, b, x, 2*k+2, (l+r)/2, r);
			node[k] = std::min(node[2*k+1], node[2*k+2]);
		}
	}
	void add(int a, long long x){ //[a,a+1)の値に加算 O(log N)
		add(a, a+1, x);
	}
	void add(int a, int b, long long x, int k=0, int l=0, int r=-1){ //[a,b)の値に加算 O(log N)
		if(r == -1) r = N;
		eval(k, l, r);
		if(b <= l || r <= a) return; //交差する場合
		if(a <= l && r <= b){ //完全に含む場合
			lazy[k] += x;
			eval(k, l, r);
		}
		else{
			add(a, b, x, 2*k+1, l, (l+r)/2);
			add(a, b, x, 2*k+2, (l+r)/2, r);
			node[k] = std::min(node[2*k+1], node[2*k+2]);
		}
	}
	long long min(int a, int b, int k=0, int l=0, int r=-1){ //[a,b)の最小値 O(log N)
		if(r == -1) r = N;
		if(b <= l || r <= a) return DEFAULT; //交差する場合
		eval(k, l, r);
		if(a <= l && r <= b) return node[k]; //完全に含む場合
		return std::min(min(a, b, k*2+1, l, (l+r)/2), min(a, b, k*2+2, (l+r)/2, r));
	}
	void print(){
		for(int i=0; i<node.size(); i++) cout << node[i] << endl;
		for(int i=0; i<node.size(); i++) cout << lazy[i] << endl;
		for(int i=0; i<node.size(); i++) cout << lazyFlg[i] << endl;
	}
};

int main(){
	int N, Q;
	cin >> N >> Q;
	SegmentTree st;
	st.init(N+1);
	st.update(0, N, INT_MAX);
	for(int q=0; q<Q; q++){
		int c, s, t;
		cin >> c >> s >> t;
		if(c == 0) st.update(s, t);
		else cout << st.min(s, t+1) << endl;
	}
}


Measured memory_bytes: 7140
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define INF 2e9
#define LINF 1e18
#define mod 1e9+7
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int a,b; cin >> a >> b;
    if (a%2==1 && b%2==1) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

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

using namespace std;

int main() {
  int n;
  cin >> n;
  int a[n];
  int odd_patt = 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) odd_patt *= 2;
  }
  
  cout << pow(3, n) - odd_patt << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    vector<double> x(n),y(n);
    vector<int> num(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
        num[i] = i;
    }
    double l=0;
    double sa_x;
    double sa_y;
    double perm=0;
    do{
        for(int i=0;i<n-1;i++){
            sa_x = x[num[i]]-x[num[i+1]];
            sa_y = y[num[i]]-y[num[i+1]];
            l += sqrt(pow(sa_x,2)+pow(sa_y,2));
        }
        perm++;
    }while(next_permutation(num.begin(),num.end()));
    cout<<fixed<<setprecision(10)<<l/perm<<endl;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
h = gets.chomp.split.map(&:to_i)

dp = Array.new(n, Float::INFINITY)

dp[0] = 0

for i in 1..n-1
  dp[i] = [dp[i], dp[i-2] + (h[i] - h[i - 2]).abs].min if i > 1
  dp[i] = [dp[i], dp[i-1] + (h[i] - h[i - 1]).abs].min
end

puts dp[n-1]


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

struct edge {
  ll to, cost;
};

int main()
{
  ll n; cin >> n;
  vector<vector<edge>> tr(n);
  rep(i, n-1) {
    ll a, b, c; cin >> a >> b >> c; a--; b--;
    tr[a].push_back(edge{b, c});
    tr[b].push_back(edge{a, c});
  }

  ll q, k; cin >> q >> k; k--;
  vector<ll> d(n, -1);
  d[k] = 0;
  queue<ll> que;
  que.push(k);
  while (!que.empty()) {
    ll p = que.front(); que.pop();
    for (auto e: tr[p]) {
      ll nt = e.to;
      ll nc = e.cost;
      if (d[nt] > -1) continue;
      d[nt] = d[p] + nc;
      que.push(nt);
    }
  }

  vector<ll> ans(q);
  rep(i, q) {
    ll x, y; cin >> x >> y; x--; y--;
    ans[i] = d[x] + d[y];
  }
  rep(i, q) cout << ans[i] << endl;


  return 0;
}



Measured memory_bytes: 10752
x, y = map(str, input().split())
if x == y:
  print("=")
else:
  if x=="A":
    print("<")
  elif x=="B":
    if y=="A":
      print(">")
    else:
      print("<")
  elif x == "C":
    if y=="A" or y=="B":
      print(">")
    else:
      print("<")
  elif x == "D":
    if y=="E" or y=="F":
      print("<")
    else:
      print(">")
  elif x == "E":
    if y == "F":
      print("<")
    else:
      print(">")
  else:
    print(">")

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    vector<int> A;
    int i;
    int n;
    cin >> n;
    for (i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        A.push_back(a);
    }
    int q;
    cin >> q;
    for (i = 0; i < q; i++)
    {
        int b, e, t;
        cin >> b >> e >> t;
        swap_ranges(A.begin() + b, A.begin() + e, A.begin() + t);
    }
    for (i = 0; i < (A.size() - 1); i++)
    {
        cout << A.at(i) << ' ';
    }
    cout << A.back() << endl;
}


Measured memory_bytes: 3160
S = str(input())
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])
if A+B+C+D == 7:
    print(str(A) + "+" + str(B) + "+" + str(C) + "+" + str(D) + "=" + "7")
elif A+B+C-D == 7:
     print(str(A) + "+" + str(B) + "+" + str(C) + "-" + str(D) + "=" + "7")
elif A+B-C+D == 7:
     print(str(A) + "+" + str(B) + "-" + str(C) + "+" + str(D) + "=" + "7")
elif A+B-C-D == 7:
     print(str(A) + "+" + str(B) + "-" + str(C) + "-" + str(D) + "=" + "7")
elif A-B+C+D == 7:
     print(str(A) + "-" + str(B) + "+" + str(C) + "+" + str(D) + "=" + "7")
elif A-B+C-D == 7:
     print(str(A) + "-" + str(B) + "+" + str(C) + "-" + str(D) + "=" + "7")
elif A-B-C+D == 7:
     print(str(A) + "-" + str(B) + "-" + str(C) + "+" + str(D) + "=" + "7")
elif A-B-C-D == 7:
     print(str(A) + "-" + str(B) + "-" + str(C) + "-" + str(D) + "=" + "7")
######

Measured memory_bytes: 38384
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
import java.util.ArrayList;
public class Main{
	public static void main(String args[]){
    int a=0,b=0,c=0,i=0,n=0,j=0,m=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));


    try{
      String line = reader.readLine();
      n = Integer.parseInt(line);
      int bar[] = new int[n];
      for(i=0;i<n;i++){
        bar[i] = i + 1;
      }
      
      line = reader.readLine();
      j = Integer.parseInt(line);
      for(i=0;i<j;i++){
        line = reader.readLine();
        String[] splitted = line.split(",");
        a = Integer.parseInt(splitted[0]);
        b = Integer.parseInt(splitted[1]);
        c = bar[a - 1];
        bar[a - 1] = bar[b - 1];
        bar[b - 1] = c;

      }
      
      for(i=0;i<n;i++){
        System.out.println(bar[i]);
      }
      
      





		}catch(Exception e){
    }




  
	}
}


Measured memory_bytes: 24252
package main
import "fmt"
func main() {
  var a,b string
  fmt.Scan(&a, &b)
  switch fmt.Sprintf("%s %s",a,b) {
  case "H H", "D D":
    fmt.Println("H")
  case "H D", "D H":
    fmt.Println("D")
  }
}

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

using namespace std;

int main(){
	int a[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 n;
	cin>>n;
	cout<<a[n-1]<<endl;
	return 0;
} 

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

namespace Fibonacci_Number
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int temp1 = 1;
            int temp2 = 1;
            int temp3 = 0;
            List<int> fibs = new List<int>();
            fibs.Add(1);
            fibs.Add(1);

            for (int i = 2; i <= 44; ++i)
            {
                temp3 = temp1 + temp2;
                fibs.Add(temp3);
                temp1 = temp2;
                temp2 = temp3;

            }

            Console.WriteLine(fibs[n]);




        }
    }
}



Measured memory_bytes: 17964
import java.util.Scanner;

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

        for(int i=1; i<=n; i++) {
            if(i % 3 == 0) {
                System.out.print(" " + i);
            } else{
            	for(int j=i; j>0; j/=10) {
            		if (j % 10 == 3) {
                        System.out.print(" " + i);
                        break;
                    }
            	}
            }
        }
        System.out.print("\n");
        sc.close();
    }
}

Measured memory_bytes: 22416
#include <bits/stdc++.h>
#define em3 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
#define X real()
#define Y imag()
#define cross(a, b) ((conj(a) * (b)).Y)
#define dot(a, b) ((conj(a) * (b)).X)
#define EPS 1e-7
long long mod = 1e9 +7;
typedef long long ll;
typedef long double ld;
const double pi = acos(-1);
typedef complex <double> point;
typedef tuple<int, int, int> line;
typedef vector<point> polygon;
ld prob[3005] , ans[3005][3005] , fin;


int main()
{
    int n;
    cin >> n;
    for(int i = 1 ; i <= n ; i++)
        cin >> prob[i];
    ans[1][0] = 1 - prob[1];
    ans[1][1] = prob[1];
    for(int i = 2 ; i <= n ; i++)
    {
        for(int j = 0 ; j <= n ; j++)
        {
            if(j <= i)
            {
                ans[i][j] = ans[i - 1][j] * (1 - prob[i]);
                if(j)
                ans[i][j] += ans[i - 1][j  - 1] * prob[i];
            }
            else
                ans[i][j] = 0;
        }
    }
    for(int i = (n + 1) / 2 ; i <= n ; i++)
        fin += ans[n][i];
    cout << fixed << setprecision(9) << fin << endl;



    return 0;
}



Measured memory_bytes: 141056
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m;
  cin>>n>>m;
  vector<pair<int,int>>p(m);
  for(int i=0;i<m;i++){
    cin>>p.at(i).first>>p.at(i).second;
  }
  for(int x=0;x<1000;x++){
    int nx=x/10;
    vector<int>d(1,x%10);
    while(nx){
      d.push_back(nx%10);
      nx/=10;
    }
    if(n!=d.size())continue;
    reverse(d.begin(),d.end());
    bool ok=true;
    for(int i=0;i<m;i++){
      if(p[i].second!=d[p[i].first-1])ok=false;
    }
    if(ok){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
 
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
     int H,W ;
     cin >> H >> W ;
     char c[100][100] ;
     for(int i=0;i<H;i++){
          for(int j=0;j<W;j++) cin >> c[j][i] ;
     }
    
  
         for(int i=0;i<H;i++){
              for(int k=0;k<2;k++){
                   for(int j=0;j<W;j++) cout << c[j][i]  ;
                   cout << '\n' ;
              }
         }
         
 
     
         
         

}


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

typedef long long ll;
const int base=1e9;

ll gcd(ll a,ll b){
    while(b){
        a=a%b;
        swap(a,b);
    }
    return a;
}

int n,scnt,ocnt;
ll a[200005];
pair<int,int> b[200005];
ll ans;
int bit[105][105];

int sum(int id,int pos){
    int res=0;
    while(pos>0){
        res+=bit[id][pos];
        pos-=pos&-pos;
    }
    return res;
}

void add(int id,int pos,int val){
    while(pos<=100){
        bit[id][pos]+=val;
        pos+=pos&-pos;
    }
}

int sum2d(int id,int pos){
    int res=0;
    while(id>0){
        res+=sum(id,pos);
        id-=id&-id;
    }
    return res;
}

void add2d(int id,int pos,int val){
    while(id<=100){
        add(id,pos,val);
        id+=id&-id;
    }
}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>n;
    for(int i=1;i<=n;i++){
        {
            static string s;
            cin>>s;
            int decp=0;while(decp<s.size()&&s[decp]!='.')decp++;
            if(decp==s.size())s+='.';
            while(s.size()-decp-1<9)s+='0';
            for(char &c:s)if(c!='.')a[i]=a[i]*10+c-'0';
        }
        {
            static ll clo;
            clo=a[i];
            while(clo&1^1)b[i].first++,clo>>=1;
            while(clo%5==0)b[i].second++,clo/=5;
        }
        add2d(max(0,18-b[i].first)+1,max(0,18-b[i].second)+1,1);
    }
    for(int i=1;i<=n;i++){
        ans+=sum2d(b[i].first+1,b[i].second+1);
        if(b[i].first>=9&&b[i].second>=9)ans--;
    }
    cout<<ans/2<<endl;

    return 0;
}

Measured memory_bytes: 6732
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
long long ans=0;
for(int i=n-1;i>=1;i-=2)
{
    ans+=a[i]-a[i-1];
}
if(n%2)
ans+=a[0];
cout<<ans;
return 0;
}
 


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
#include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
#include <stack>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main()
{
	int n,m;
	cin >> n >> m;
	vector<vector<int>> ab(n);
	rep(i,m)
	{
		int foo , fooo;
		cin >> foo >> fooo;
		foo--;fooo--;
		ab[foo].emplace_back(fooo);
	}
	//cout<<1<<endl;
	stack<int> s;
	rep(i,ab[0].size())
	{
		
			s.push(ab[0][i]);
	}

	while(s.size())
	{
		int now = s.top();
		s.pop();
		rep(i,ab[now].size())
	if(ab[now][i]==n-1)
	{
		cout<<"POSSIBLE"<<endl;
		return 0;
	}
	}
	
	cout<<"IMPOSSIBLE"<<endl;
	return 0;
}

Measured memory_bytes: 8824
#include<stdio.h>
int main()
{
    int i,j,m,n,s,w,p,max,a[10000],b[10000],c[10000],d[10000];
    while(scanf("%d",&n)!=EOF)
    {
        s=0;
        for(i=0;i<n;i++)
            scanf("%d %d",&a[i],&b[i]);
        for(i=0;i<n;i++)
            scanf("%d %d",&c[i],&d[i]);
        for(i=0;i<n-1;i++)
            for(j=0;j<n-i-1;j++)
        {
            if(a[j]>a[j+1])
            {
                p=a[j];
                a[j]=a[j+1];
                a[j+1]=p;
                p=b[j];
                b[j]=b[j+1];
                b[j+1]=p;
            }
        }
        for(i=0;i<n-1;i++)
            for(j=0;j<n-i-1;j++)
        {
            if(c[j]>c[j+1])
            {
                p=c[j];
                c[j]=c[j+1];
                c[j+1]=p;
                p=d[j];
                d[j]=d[j+1];
                d[j+1]=p;
            }
        }
        for(i=0;i<n;i++)
        {
            p=-1;
            max=-1;
            for(j=0;j<n;j++)
            {
                if(a[j]<c[i]&&b[j]<d[i]&&b[j]>max&&a[j]!=-1&&b[j]!=-1)
                {
                    max=b[j];
                    p=j;
                }
                if(a[j]>c[i])
                   break;
            }
            if(p!=-1)
            {
                s++;
                a[p]=-1;
                b[p]=-1;
            }
        }
        printf("%d\n",s);
    }
    return 0;
}


Measured memory_bytes: 128
def main():
    N = int(input())
    H = [int(x) for x in input().split()]
    k = True
    for i in range(1, N):
        if H[i] >= H[i-1]:
            if H[i] - 1 >= H[i - 1]:
                H[i] = H[i] - 1
        else:
            k = False
            break
    if k:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Measured memory_bytes: 14396
// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair< int, int > pii;
typedef pair< pii, int > ppi;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 2000100;



int main(){
        _
        ll n,a,b; cin >> n >> a >> b;
        ll sum = a + b;
        ll x = n / sum;
        ll ans = x * a + min(n % sum, a);
        cout << ans <<endl;

return 0;
}




Measured memory_bytes: 256
#include<iostream>
using namespace std;
string a="qwertasdfgzxcvb";
main(){
  string b;while(cin>>b&&b!="#"){
    int c=-1,d=-1;
    for(int i=0;i<b.size();i++){
      int e=1;
      for(int j=0;j<a.size();j++)if(a[j]==b[i])e=0;
      if (d!=e)c++;
      d=e;
    }
    cout<<c<<endl;
  }
}

Measured memory_bytes: 0
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var N = myconv(next(),1);
  var list = myconv(next(),4);
  if(N == 2){
     myout(Math.max.apply(null,list));
    return;
  }
  var leftList = new Array(N - 1);
  var rightList = new Array(N - 1);
  for(var i = 0; i < N - 1; i++){
    if(i == 0){
       leftList[i] = list[i];
    }else{
      leftList[i] = gcd(leftList[i - 1],list[i]);
    }
  }
  for(var i = N - 1; i > 0; i--){
    if(i == N - 1){
       rightList[i - 1] = list[i];
    }else{
       rightList[i - 1] = gcd(rightList[i],list[i]);
    }
  }
  myerr(leftList);
  myerr(rightList);
  var output = 1;
  for(var i = 0; i < N; i++){
    var tmp;
    switch (i){
      case 0:
        tmp = rightList[i];
        break;
      case N - 1:
        tmp = leftList[i - 1];
        break;
      default:
        tmp = gcd(leftList[i - 1],rightList[i]);
        break;
    }
    output = Math.max(output,tmp);
  }
  myout(output);
}
function gcd(m, n) {return n != 0 ? gcd(n, m % n) : m;}

Measured memory_bytes: 70432
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

H, W, K = MI()
C = []

for _ in range(H):
    C.append(input())

ans = 0    

for h in range(1 << H):
    for w in range(1 << W):
        sharp = 0
        for i in range(H):
            if (h >> i) & 1:
                continue
            for j in range(W):
                if (w >> j) & 1:
                    continue
                sharp += int(C[i][j] == "#")
        
        if sharp == K:
            ans += 1

print(ans)

Measured memory_bytes: 68272
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>
#include <unordered_map>

using namespace std;
typedef long long int ll;

#define SP(x) setprecision((int)x)
#define ALL(v) v.begin(), v.end()

/* デカい配列はここで宣言 */

int main(int argc, char const *argv[])
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (ll i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(ALL(a));
    ll ma = *max_element(ALL(a));
    ll in = (max_element(ALL(a)) - a.begin());
    double d = 1000000005;
    double h = ma / 2.0;
    ll ii = 0;
    for (ll i = 0; i < n - 1; i++)
    {
        double temp = abs(a[i] - h);
        if(temp<d){
            d = temp;
            ii = a[i];
        }
    }
    cout << ma << " " << ii << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=100000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};


int main() {


	int a[4];

	rep(i,3)

	cin>>a[i];

	sort(a, a + 3, greater<int>());


	cout<<a[0]-a[2]<<endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define ll long long int
#define sec ->second
#define fir ->first
#define mapi map<int,int>
#define veci vector<int,int>
#define pb(a) .push_back(a)
#define pob(a) .pop_back(a)
#define fori(a) for(int i=0;i<a;i++)
#define forill(a) for(long long int i=0;i<a;i++)
#define listi list<int>
int main()
{
    int n,flag=0;cin>>n;
    while(n!=0){
        int temp=n%10;
        n/=10;
        if(temp==7){
            cout<<"Yes";
            flag=1;
            break;
        }
    }
    if(flag==0)cout<<"No";
    return 0;
}


Measured memory_bytes: 3624
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
 
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define mod 1000000007
using ll = long long;
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  if(a > 8 || b > 8) cout << ":(" << endl;
  else cout << "Yay!" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	ll a[20][20];
	ll dp[(1<<16)];
	ll all[(1<<16)];
	scan(N);
	rep(i,N){
		rep(j,N){
			scan(a[i][j]);
		}
	}
	int twoNth=(1<<N);
	rep(bit,twoNth){
		ll pt=0;
		rep(i,N-1){
			for(int j=i+1;j<N;j++){
				if(1&(bit>>i)&(bit>>j)){
					pt+=a[i][j];
				}
			}
		}
		all[bit]=pt;
	}
	rep(bit,twoNth){
		dp[bit]=all[bit];
		int onenum=0;
		int nowbit=bit;
		while(nowbit){
			onenum+=(nowbit&1);
			nowbit>>=1;
		}
		int twopartial=(1<<onenum);
		rep(partialbit,twopartial){
			int nowpartial=partialbit;
			rep(keta,N){
				if((nowpartial>>keta)==0) break;
				if(((bit>>keta)&1)==0){
					nowpartial=((nowpartial>>keta)<<(keta+1))+nowpartial%(1<<keta);
				}
			}
			dp[bit]=max(dp[bit],dp[bit-nowpartial]+dp[nowpartial]);
		}
	}
	/*rep(bit,twoNth){
		int now=bit;
		rep(i,N){
			printf("%d",now&1);
			now>>=1;
		}
		printf("  all:%lld dp:%lld\n",all[bit],dp[bit]);
	}*/
	prin(dp[twoNth-1]);
	return 0;
}


Measured memory_bytes: 1280
/**
 *  author:   TakeruOkuyama
 *  created:  2020-04-15 11:17:28
**/
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MOD = 1000000007;
const int INF = 999999999;

int main(){
    int N;
    cin >> N;
    vector<int> H(N);
    int max = 0;
    rep(i, N){
        cin >> H[i];
    }
    int ans = 0;
    rep(i, N){
        if(max <= H[i]){
            ans++;
            max = H[i];
        }
    }
    cout << ans << endl;
return 0;}

/**
 * g++ code.cpp
 * ./a.out
 * shift + ctrl + i
**/ 

Measured memory_bytes: 256
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
using namespace std;
//#include <vector>
//#include <stack>
//#include <queue>

/*
#include <math.h>
int standerd = int(pow(10.0,9.0)) + 7;
*/
string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 
#include <string>


int getIntSubstr(string s,int start_index,int length){
    return atoi(s.substr(start_index,length).c_str());
}
  
int main(){

    string S;
    cin >> S;

    int tmp;
    
    tmp = getIntSubstr(S,0,2);
    if(tmp>0 and tmp < 13){
        tmp = getIntSubstr(S,2,2);
        if(tmp>0 and tmp < 13){
            cout << "AMBIGUOUS";
        }else{
            cout << "MMYY";
        }
        
    }else{
        tmp = getIntSubstr(S,2,2);
        if(tmp>0 and tmp < 13){
            cout << "YYMM";
        }else{

            cout << "NA";
        }

    }

}

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

long long int gcd(long long int a,long long int b){
	if(b==0)
//		cout<<b<<endl;
		return a;
	gcd(b,a%b);
} 

int main(){
	
	long long int a,b;
	cin>>a>>b;
	if(a<b)//保持a是最大的 
		swap(a,b);
	long long int c;
	c = gcd(a,b);
	cout<<c<<endl;
	
	return 0;
}


Measured memory_bytes: 3096
package main

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

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt() int {
  n, _ := strconv.Atoi(NextLine())
  return n
}
func NextIntVec() []int {
  L := strings.Split(NextLine(), " ")
  N := make([]int, len(L))
  for i := range N {
    N[i], _ = strconv.Atoi(L[i])
  }
  return N
}
func NextFloat() float64 {
  n, _ := strconv.ParseFloat(NextLine(), 64)
  return n
}
func NextFloatVec() []float64 {
  L := strings.Split(NextLine(), " ")
  N := make([]float64, len(L))
  for i := range N {
    N[i], _ = strconv.ParseFloat(L[i], 64)
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func Max(x, y int) int {
  if x < y { return y }
  return x
}

func Count(cnt *int, N int) int {
  if N < 10 { return N }
  S := 0
  for 10 <= N {
    S += N % 10
    (*cnt) += N / 10
    N /= 10
  }
  return Count(cnt, N + S)
}

func main() {
  M := NextInt()
  cnt := M - 1
  C := make([]int, M)
  for i := range C {
    DC := NextIntVec()
    d, c := DC[0], DC[1]
    cnt += c - 1
    dc := d * c
    C[i] = Count(&cnt, dc)
  }
  d := 0
  for _, c := range C {
    d = Count(&cnt, d + c)
  }
  Write(cnt)
  Output()
}

Measured memory_bytes: 6144
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		SC sc=new SC(System.in);
		int N=sc.nextInt();
		int max=0;
		int jun=0;
		for(int i=0; i<N; i++) {
			int tmp=sc.nextInt();
			int a=sc.nextInt();
			if(tmp>max) {
				max=tmp;
				jun=a;
			}
		}
		pl(max+jun);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
}


Measured memory_bytes: 40992
#include<stdio.h>

int main(){
	
	int a,b,c;
	
	scanf("%d%d%d",&a,&b,&c);
	
	if(a == 5 && b == 5 && c == 7){
		printf("YES\n");
	}else if(a == 5 && c == 5 && b == 7){
		printf("YES\n");
	}else if(b == 5 && c == 5 && a == 7){
		printf("YES\n");
	}else{
		printf("NO\n");
	}
	
	return 0;
}

Measured memory_bytes: 128
import java.io.*;
import java.util.*;
 
public class Main {
 
	void submit() {
	    int X = nextInt();
	    int Y = nextInt();
	    int Z = nextInt();
	    
        out.print(Z);
        out.print(" ");
        out.print(X);
        out.print(" ");
        out.print(Y);        
	}

	void preCalc() {
 
	}
 
	void stress() {
 
	}
 
	void test() {
 
	}
 
	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}
 
	static final Random rng = new Random();
 
	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}
 
	public static void main(String[] args) throws IOException {
		new Main();
	}
 
	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
 
	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}
 
	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
	int nextInt() {
		return Integer.parseInt(nextToken());
	}
 
	long nextLong() {
		return Long.parseLong(nextToken());
	}
 
	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 23252
#!/usr/bin/env python3

n = int(input())
s = input()
hs = [ int(i) for i in s.rsplit() ]

max=0; lmax=0
for i in range (1,len(hs)):
  if hs[i] <= hs[i-1]:
    lmax=lmax+1
  else:
    if lmax > max:
      max = lmax
    lmax = 0

if lmax > max:
  max = lmax

print(max)

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

int x[4] = {-1, 0, 1, 0};
int y[4] = {0, -1, 0, 1};

int main() {
  int h, w;
  cin >> h >> w;
  int ch, cw;
  cin >> ch >> cw;
  int dh, dw;
  cin >> dh >> dw;
  ch--, cw--, dh--, dw--;
  vector<vector<char>> s(h, vector<char>(w));
  rep(i,h) rep(j,w) cin >> s[i][j];

  vector<vector<int>> dist(h, vector<int>(w,M));
  deque<pair<int,int>> q;
  dist[ch][cw] = 0;  
  q.emplace_back(ch,cw);
  while(!q.empty()){
    int i = q.front().first;
    int j = q.front().second;
    q.pop_front();
    int d = dist[i][j];

    // コスト0の移動
    rep(v,4){
      int ni = i + x[v];
      int nj = j + y[v];
      if(ni < 0 || nj < 0 || ni >= h || nj >= w) continue;
      if(s[ni][nj] == '#') continue;
      if(dist[ni][nj] <= d) continue;
      dist[ni][nj] = d;
      q.emplace_front(ni,nj);
    }

    // コスト1の移動
    for(int ni = i-2; ni <= i+2; ni++){
      for(int nj = j-2; nj <= j+2; nj++){
        if(ni < 0 || nj < 0 || ni >= h || nj >= w) continue;
        if(s[ni][nj] == '#') continue;
        if(dist[ni][nj] <= d+1) continue;
        dist[ni][nj] = d + 1;
        q.emplace_back(ni,nj);
      }
    }
  }

  int ans = dist[dh][dw];
  if (ans == M) cout << -1 << endl;
  else cout << ans << endl;

  return 0;
}


Measured memory_bytes: 8512
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int> > a(n+1,vector<int>(m+1));
  for(int i=0;i<n;i++){
    
    for(int j=0;j<m;j++){
      cin>>a[i][j];
      a[i][m]+=a[i][j];
    }
    
  }
  for(int i=0;i<m;i++){
    
    for(int j=0;j<n;j++){
      a[n][i]+=a[j][i];
    }
  }


  for(int i=0;i<m;i++){
    a[n][m]+=a[n][i];
  }
 
  for(int i=0;i<=n;i++){
    for(int j=0;j<=m;j++){
      if(j!=m){
      cout<<a[i][j]<<" ";
      }
      else{
        cout<<a[i][j];
    }
    }
    cout<<endl;
  
  }
}
  


Measured memory_bytes: 3152
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", ans);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(void) {
  int a, b;
  cin >> a >> b;

  if (a == 1 && b == 2) cout << 3;
  if (a == 1 && b == 3) cout << 2;
  if (a == 2 && b == 1) cout << 3;
  if (a == 2 && b == 3) cout << 1;
  if (a == 3 && b == 1) cout << 2;
  if (a == 3 && b == 2) cout << 1;
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)} 

for i in 1..r

a= gets.split.map(&:to_i)
    for j in 1..c
    h[i-1][j-1] = a[j-1]
    h[i-1][c] += a[j-1]
    h[r][j-1] += a[j-1]
    h[r][c] += a[j-1]
    end
end
for i in 0..r
    for j in 0..c
      print " " unless j == 0
      print h[i][j]
    end
    print "\n"
  end



Measured memory_bytes: 7028
import math
from decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP

n = int(input())

for _ in range(n):
    x1, y1, x2, y2, x3, y3 = map(float, input().split())

    a2 = (x2-x3)**2 + (y2-y3)**2
    b2 = (x1-x3)**2 + (y1-y3)**2
    c2 = (x1-x2)**2 + (y1-y2)**2
    area = ((x2-x1) * (y3-y1) - (x3-x1) * (y2-y1)) / 2

    x = (a2*(b2+c2-a2)*x1 + b2*(c2+a2-b2) *
         x2 + c2*(a2+b2-c2)*x3) / (16*area*area)
    y = (a2*(b2+c2-a2)*y1 + b2*(c2+a2-b2) *
         y2 + c2*(a2+b2-c2)*y3) / (16*area*area)
    r = ((x1-x)**2 + (y1-y)**2)**0.5

    x = Decimal(str(x)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)
    r = Decimal(str(r)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)

    print(x, y, r)



Measured memory_bytes: 6504
N, M = map(int, input().split())
ab = []
for i in range(M):
    ab.append(list(map(int, input().split())))

num = [0]*N
for i in range(M):
    num[ab[i][0]-1] += 1
    num[ab[i][1]-1] += 1

for val in num:
    print(val)


Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <stdio.h>
using namespace std;
int main(void){
    int a, b;
    cin >> a >> b ;
    
    int waru = a / b;
    
    int amari = a % b;
    
    double syousu = (double)a / b;
    
    //cout << waru << " " << amari << " " << setprecision(1) << syousu << endl;
    printf("%d %d %.10f\n",waru, amari, syousu);
    
}


Measured memory_bytes: 3208
use std::io::{stdin, BufRead, BufReader};

struct Position {
    x: f32,
    y: f32,
}

fn main() {
    let input = BufReader::new(stdin());
    let mut position = Position { x: 0.0, y: 0.0 };
    let mut angle: i32 = 90;
    for line in input.lines() {
        let values: Vec<i32> = line.unwrap()
            .trim()
            .split(",")
            .filter_map(|x| x.parse::<i32>().ok())
            .collect();
        let d = values[0] as f32;
        let rad = ((angle % 360) as f32).to_radians();
        position.x += d * rad.cos();
        position.y += d * rad.sin();
        angle -= values[1];
    }
    println!("{}", position.x.trunc());
    println!("{}", position.y.trunc());
}



Measured memory_bytes: 5132
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    int a[3];
    for (int i=0; i<3; i++) cin >> a[i];
    sort(a, a+3);
    cout << a[0] << ' ' << a[1] << ' ' << a[2] << endl;
    return 0;
}


Measured memory_bytes: 3168