Submission details
Task:Lukujono
Sender:pupukani
Submission time:2025-11-28 21:45:34 +0200
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1--details
#2--details
#3ACCEPTED0.01 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:10:30: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   10 |         for (size_t i = 0; i < t; ++i)
      |                            ~~^~~

Code

#include <iostream>
#include <sstream>
#include <vector>

int main(void)
{
	int t;
	std::cin >> t;
	std::vector<int> xx;
	for (size_t i = 0; i < t; ++i)
	{
		int x;
		std::cin >> x;
		xx.push_back(x);
	}

	for (int x : xx)
	{
		int pituus = 0;
		while (true)
		{
			pituus++;
			if (x == 1 || x < 0)
				break;
			if (x % 3 == 0)
				x /= 3;
			else
				x = x * 2 + 1;
		}
		if (x < 0)
			pituus = -1;
		std::cout << pituus << std::endl;
	}
}

Test details

Test 1

Verdict:

input
1000
1
2
3
4
...

correct output
1
-1
2
4
-1
...

user output
(empty)

Test 2

Verdict:

input
1000
152435
165584
587562
428318
...

correct output
-1
-1
-1
-1
-1
...

user output
(empty)

Test 3

Verdict: ACCEPTED

input
1000
235119
235120
235144
236196
...

correct output
27
27
27
14
27
...

user output
27
27
27
14
27
...