QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#147053#3905. Hockey championshipOneWanWA 1ms3636kbC++20794b2023-08-22 18:58:452023-08-22 18:58:47

Judging History

This is the latest submission verdict.

  • [2023-08-22 18:58:47]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3636kb
  • [2023-08-22 18:58:45]
  • Submitted

answer

// Problem: H - Long integer
// Contest: Virtual Judge - Namomo Summer Camp 23 Day 2
// URL: https://vjudge.net/contest/576885#problem/H
// Memory Limit: 254 MB
// Time Limit: 2000 ms

#include <bits/stdc++.h>
using namespace std;

// 2023 OneWan
int ans[500005];
const int mod = 1000000007;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string x0;
	cin >> x0;
	int tot = 1;
	for (auto &i : x0) {
		ans[tot] = (ans[tot - 1] * 10LL + (i xor 48)) % mod;
		tot++;
	}
	tot--;
	int q;
	cin >> q;
	while (q--) {
		char op;
		cin >> op;
		if (op == '+') {
			int d;
			cin >> d;
			ans[tot + 1] = (ans[tot] * 10LL + d) % mod;
			tot++;
		} else {
			tot--;
		}
		if (tot == -1) {
			tot++;
		}
		cout << ans[tot] << "\n";
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3636kb

input:

2 1

output:

0

result:

wrong answer The number of countries cannot be zero