QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209514#7112. XOR CliquePetroTarnavskyi#WA 0ms3604kbC++171.2kb2023-10-10 15:28:082023-10-10 15:28:09

Judging History

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

  • [2023-10-10 15:28:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3604kb
  • [2023-10-10 15:28:08]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first	
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

void solve()
{
	LL a, b, c, d, v, t;
	cin >> a >> b >> c >> d >> v >> t;
	LL lcm = a * c / gcd(a, c);
	LL counter = 0, i = 1, j = 1, lastLED = 0, lastBlock = 0;
	while (i * a < lcm)
	{
		LL ia = i * a, jc = j * c;
		if (ia <= jc)
		{
			counter += b;
			if (ia - lastLED > v)
				counter--;
			lastLED = ia;
			if (ia <= t % lcm)
				lastBlock = counter;
			i++;
		}
		if (jc <= ia)
		{
			counter += d;
			if (jc - lastLED > v)
				counter--;
			lastLED = jc;
			if (jc <= t % lcm)
				lastBlock = counter;
			j++;
		}
	}
	cout << b + d - 1 + (t / lcm) * counter + lastBlock << "\n";
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(15);
	int t;
	cin >> t;
	while (t--)
		solve();
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3604kb

input:

3
3
1 2 3
3
1 1 1
5
1 2323 534 534 5

output:

3
429
116

result:

wrong answer 1st numbers differ - expected: '2', found: '3'