QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#879779#9979. Corrupted Scoreboard LogyuanruiqiWA 9ms3584kbC++261.4kb2025-02-02 13:54:222025-02-02 13:54:23

Judging History

This is the latest submission verdict.

  • [2025-02-02 13:54:23]
  • Judged
  • Verdict: WA
  • Time: 9ms
  • Memory: 3584kb
  • [2025-02-02 13:54:22]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t, n;
	cin >> t >> n;
	while (t--)
	{
		string s;
		cin >> s;
		for (int l=2;l<=s.size()&&isdigit(s[l-1]);++l)
		{
			string t = s.substr(l), e = s.substr(0, l);
			vector<string> v;
			while (t.size())
				for (int i=0;i<t.size();++i)
					if (t[i] == 's' || t[i] == 'y')
					{
						v.emplace_back(t.substr(0, i + 1));
						t.erase(t.begin(), t.begin() + i + 1);
						break;
					}
			int m = v.size(), ok = 0;
			for (int s=0;s<(1<<m);++s)
			{
				int o = 1;
				int p = 0, c = 0;
				string f;
				for (int i=0;i<m&&o;++i)
				{
					int x, y;
					if (s >> i & 1) x = 5, y = 2;
					else if (v[i].back() == 'y') x = 3, y = 1;
					else x = 5, y = 3;
					if (x + y > v[i].size()) {o = 0; break;}
					string a = v[i].substr(0, v[i].size() - x - y), b = v[i].substr(v[i].size() - x - y, x), d = v[i].substr(v[i].size() - y);
					if (a.size() && a[0] == '0' || b.size() && b[0] == '0') {o = 0; break;}
					if (x + y == v[i].size()) { f += b + " " + d; continue;}
					++c;
					p += stoi(a) + 20 * (stoi(b) - 1);
					f += a + " " + b + " " + d;
				}
				if (e == to_string(c) + to_string(p))
				{
					ok = 1;
					cout << c << ' ' << p << ' ' << f << '\n';
					break;
				}
			}
			if (ok) break;
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 9ms
memory: 3584kb

input:

4 12
99351583tries261try312tries231try4tries431try2412tries551try991try1791try
912121482tries572tries392tries821try4tries431try521try2492tries1842tries2183tries
912181082tries141try542tries922tries6tries302tries6tries502tries2441try1956tries1714tries
913221241try261try542tries1331try2002tries621try2...

output:


result:

wrong answer Line [name=s_i] equals to "", doesn't correspond to pattern "[tryies0-9\ ]{1,9999}" (test case 1)