Language: C++

#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)
#define TPL template
#define TNM typename

using ll = long long;
using ull = unsigned long long;
TPL<TNM T> using vec = vector<T>;
TPL<TNM T> using vec2 = vec<vec<T>>;
TPL<TNM T> using vec3 = vec<vec2<T>>;
TPL<TNM T> using vec4 = vec<vec3<T>>;
TPL<TNM T> using vec5 = vec<vec4<T>>;

TPL<TNM V, TNM H> void resize(vector<V>& v, const H h) { v.resize(h); }
TPL<TNM V, TNM H, TNM ... T> inline void resize(vector<V>& v, const H& h, const T ... t) { v.resize(h); for (auto& _v : v) resize(_v, t ...); }
TPL<TNM V, TNM T> void fill(V& x, const T& val) { x = val; }
TPL<TNM V, TNM T> inline void fill(vector<V>& vec, T& val) { for (auto& v : vec) fill(v, val); }
TPL<TNM T> inline void UNIQUE(vector<T>& vec) { sort(ALL(vec)); vec.erase(unique(ALL(vec)), vec.end()); }

class YukiIO {
	bool f = false; //改行が残っている否か
	char* buff;
	int sbuff;
	string format;
public:
	YukiIO(int s_, int pre_) { sbuff = s_; buff = new char[s_]; format = "%." + to_string(pre_) + "lf"; }
	~YukiIO() { delete buff; }
	//--------------input---------------
	inline void get(int &i_) { f = true; scanf("%d", &i_); }
	inline void get(long long &l_) { f = true; scanf("%lld", &l_); }
	inline void get(double &d_) { f = true; scanf("%lf", &d_); }
	inline void get(float &f) { f = true; scanf("%f", &f); }
	inline void get(char &c_) {
		if (f)scanf("%*c%c", &c_);
		else scanf("%c", &c_);
		f = true;
	}
	inline void get(char* s_) { f = true; scanf("%s", s_); }
	inline void get(string &s_) { f = true; scanf("%s", buff); s_ = string(buff); }
	template <typename HEAD, typename ...TAIL>inline void get(HEAD& head, TAIL& ...tails) {
		get(head);
		get(tails...);
	}
	template <typename T> inline void get(vector<T>& v_) {
		for (int i = 0; i < v_.size(); ++i) get(v_[i]);
	}
	inline void getl(string& s_) {
		if (f) { char dm; scanf("%c", &dm); }
		fgets(buff, sbuff, stdin);
		s_ = string(buff);
		f = false;
	}
	template <typename ...ARGS> inline void getf(const char* format, ARGS& ... args) {
		if (f)scanf("%*c%[^\n]", buff);
		else scanf("%[^\n]", buff);
		sscanf(buff, format, &args...);
		f = true;
	}
	//--------------outut---------------
	inline void print(bool b_) { printf("%s", b_ ? "true" : "false"); }
	inline void print(int i_) { printf("%d", i_); }
	inline void print(unsigned int i_) { printf("%d", i_); }
	inline void print(long long l_) { printf("%lld", l_); }
	inline void print(unsigned long long l_) { printf("%lld", l_); }
	inline void print(double d_) { printf(format.data(), d_); }
	inline void print(float f) { printf("%f", f); }
	inline void print(char c_) { printf("%c", c_); }
	inline void print(char* s_) { printf("%s", s_); }
	inline void print(string &s_) { printf("%s", s_.data()); }
	inline void print(const char* s_) { printf("%s", s_); }
	template <typename T> inline void print(vector<T>& v) {
		print(v[0]);
		for (int i = 1; i < v.size(); ++i) {
			putchar(' '); print(v[i]);
		}
	}
	inline void println() { puts(""); }
	template <typename T> inline void println(vector<T>& v) { for (int i = 0; i < v.size(); ++i) println(v[i]); }
	template <typename HEAD, typename ...TAIL>inline void print(HEAD head, TAIL ...tails) {
		print(head);
		print(tails...);
	}
	template <typename ...ARGS>inline void println(ARGS ...args) {
		print(args...);
		puts("");
	}
};

YukiIO io(114514, 12);

int f(int n) {
	if (n & 1) {
		return 3 * n + 1;
	}
	else {
		return n / 2;
	}
}

int main(void) {
	int s;
	io.get(s);
	set<int> st;
	st.insert(s);
	while (1) {
		s = f(s);
		if (st.count(s) != 0) {
			io.println(st.size() + 1);
			return 0;
		}
		st.insert(s);
	}
	return 0;
}

Compiler output:
a.cc: In instantiation of 'void YukiIO::print(HEAD, TAIL ...) [with HEAD = long unsigned int; TAIL = {}]':
a.cc:89:8:   required from 'void YukiIO::println(ARGS ...) [with ARGS = {long unsigned int}]'
   89 |                 print(args...);
      |                 ~~~~~^~~~~~~~~
a.cc:113:14:   required from here
  113 |                         io.println(st.size() + 1);
      |                         ~~~~~~~~~~^~~~~~~~~~~~~~~
a.cc:86:22: error: no matching function for call to 'YukiIO::print()'
   86 |                 print(tails...);
      |                 ~~~~~^~~~~~~~~~
a.cc:76:43: note: candidate: 'template<class T> void YukiIO::print(std::vector<_Tp>&)'
   76 |         template <typename T> inline void print(vector<T>& v) {
      |                                           ^~~~~
a.cc:76:43: note:   candidate expects 1 argument, 0 provided
a.cc:84:63: note: candidate: 'template<class HEAD, class ... TAIL> void YukiIO::print(HEAD, TAIL ...)'
   84 |         template <typename HEAD, typename ...TAIL>inline void print(HEAD head, TAIL ...tails) {
      |                                                               ^~~~~
a.cc:84:63: note:   candidate expects at least 1 argument, 0 provided
a.cc:65:21: note: candidate: 'void YukiIO::print(bool)'
   65 |         inline void print(bool b_) { printf("%s", b_ ? "true" : "false"); }
      |                     ^~~~~
a.cc:65:21: note:   candidate expects 1 argument, 0 provided
a.cc:66:21: note: candidate: 'void YukiIO::print(int)'
   66 |         inline void print(int i_) { printf("%d", i_); }
      |                     ^~~~~
a.cc:66:21: note:   candidate expects 1 argument, 0 provided
a.cc:67:21: note: candidate: 'void YukiIO::print(unsigned int)'
   67 |         inline void print(unsigned int i_) { printf("%d", i_); }
      |                     ^~~~~
a.cc:67:21: note:   candidate expects 1 argument, 0 provided
a.cc:68:21: note: candidate: 'void YukiIO::print(long long int)'
   68 |         inline void print(long long l_) { printf("%lld", l_); }
      |                     ^~~~~
a.cc:68:21: note:   candidate expects 1 argument, 0 provided
a.cc:69:21: note: candidate: 'void YukiIO::print(long long unsigned int)'
   69 |         inline void print(unsigned long long l_) { printf("%lld", l_); }
      |                     ^~~~~
a.cc:69:21: note:   candidate expects 1 argument, 0 provided
a.cc:70:21: note: candidate: 'void YukiIO::print(double)'
   70 |         inline void print(double d_) { printf(format.data(), d_); }
      |                     ^~~~~
a.cc:70:21: note:   candidate expects 1 argument, 0 provided
a.cc:71:21: note: candidate: 'void YukiIO::print(float)'
   71 |         inline void print(float f) { printf("%f", f); }
      |                     ^~~~~
a.cc:71:21: note:   candidate expects 1 argument, 0 provided
a.cc:72:21: note: candidate: 'void YukiIO::print(char)'
   72 |         inline void print(char c_) { printf("%c", c_); }
      |                     ^~~~~
a.cc:72:21: note:   candidate expects 1 argument, 0 provided
a.cc:73:21: note: candidate: 'void YukiIO::print(char*)'
   73 |         inline void print(char* s_) { printf("%s", s_); }
      |                     ^~~~~
a.cc:73:21: note:   candidate expects 1 argument, 0 provided
a.cc:74:21: note: candidate: 'void YukiIO::print(std::string&)'
   74 |         inline void print(string &s_) { printf("%s", s_.data()); }
      |                     ^~~~~
a.cc:74:21: note:   candidate expects 1 argument, 0 provided
a.cc:75:21: note: candidate: 'void YukiIO::print(const char*)'
   75 |         inline void print(const char* s_) { printf("%s", s_); }
      |                     ^~~~~
a.cc:75:21: note:   candidate expects 1 argument, 0 provided