QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#494216#5006. HeximalInk_baiCompile Error//C++142.6kb2024-07-27 14:46:422024-07-27 14:46:42

Judging History

你现在查看的是最新测评结果

  • [2024-07-27 14:46:42]
  • 评测
  • [2024-07-27 14:46:42]
  • 提交

answer

#define _CRT_SECURE_NO_WARNINGS
#define itn int
#define PII pair<int, int>
#define PLI pair<long long, int>
#define fep(i,a,b) for(int i = (a); i >= (b); --i)
#define rep(i,a,b) for(int i = (a); i <= (b); ++i)
#include<bits/stdc++.h>
#include<unordered_map>
using ll = long long;
using ldou = long double;
using unll = unsigned long long;
using namespace std;

ll gcd(ll a, ll b) { // 最大公约数
	while (b ^= a ^= b ^= a %= b)
		;
	return a;
}
ll lcm(ll a, ll b) { // 最小公倍数
	return a / gcd(a, b) * b;
}
ll qmi(ll m, ll k, ll p) { // 快速幂
	// 求 m^k mod p,时间复杂度 O(logk)。
	// m为底数,k为幂
	ll res = 1 % p, t = m;
	while (k) {
		if (k & 1) res = res * t % p;
		t = t * t % p;
		k >>= 1;
	}
	return res;
}
unll qmi(unll m, unll k, unll p) { //龟速乘
	ll res = 0, t = m;
	while (k) {
		if (k & 1) res = (res + t) % p;
		k >>= 1;
		t = (t << 1) % p;
	}
	return res;
}

//////////////////////////////////////////////////////////////////////////////////

unll n, m, k;

const int N = 5e6 + 5;
const ll INF = 4e18;
const ll MODE = ll(998244353);
const unll base = 131;
const unll prime = 233317;
const int dx[4] = { 1,-1, 0, 0 };
const int dy[4] = { 0, 0, 1,-1 };
//priority_queue<unll, vector<unll>, greater<unll> >pq;

string nums;
string s2;
/[表情]ector<int>res;

void solve() {

	cin >> nums;

	//k = 1;

	int cnt = 0;

	int x = 0, y = 0;
	while (1) {

		y = 0;
		int len = nums.length();
		s2.resize(nums.length());
		for (int i = 0; i < len; i++) {

			y *= 10;
			s2[i] = (nums[i] - '0' + y) / 6 + '0';
			y = (nums[i] - '0' + y) % 6;
			/*cout << "  i  " << i << "  " << y << '\n';
			cout << "   " << nums[i] - '0' + y << '\n';*/
		}
		//res.push_back(y);

		cnt++;

		//cout << "  y  " << y << '\n';

		/*if (y < 6 && nums.length() == 1) {
			break;
		}*/

		if (len == 1 && nums[0] - '0' < 6) {
			break;
		}

		x = y;
		/*for (int i = 0; i < 30; i++)
			cout << s2[i] << ' ';
		cout << '\n';*/

		int i;
		for (i = 0; i < s2.length(); i++)
			if (s2[i] != '0')
				break;

		/*cout << "  s2  " << s2 << '\n';
		cout << "  nums  " << nums << '\n';*/

		nums = "";
		nums.resize(s2.length() - i);
		int j = 0;
		for (i; i < s2.length(); i++)
			nums[j++] = s2[i];

		//cout << " ****** \n";
	}



	cout << /*res.size()*/cnt << '\n';



}

signed main() {
	std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);
	//freopen("wrt.txt", "r", stdin); 
	//freopen("out.txt", "w", stdout);
	int TTT = 1; //cin >> TTT;
	while (TTT--) {
		solve();
	}
	/*while (cin >> n >> m) {
		solve();
	}*/

	return 0;
}

详细

answer.code:58:1: error: expected unqualified-id before ‘/’ token
   58 | /[表情]ector<int>res;
      | ^