QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#246604#5158. Interview Questionthanhchauns2#WA 1ms3496kbC++202.8kb2023-11-10 22:51:352023-11-10 22:51:36

Judging History

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

  • [2023-11-10 22:51:36]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3496kb
  • [2023-11-10 22:51:35]
  • 提交

answer

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define rd read()
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define p pair
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
namespace {
	typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<ll,ll> pll;
//	istream& operator>>(istream& i, ll &v){ long long t; i >> t; v = t;	return i;}
//	ostream& operator<<(ostream& out, ll &v){ 
//		vector<long long> x; ll u = v; 
//		while(u){x.pb(u % 10); u /= 10;} 
//		reverse(x.begin(), x.end()); 
//		for (auto &o : x){out << o;} return out;
//	}
	ll read(){ ll x; cin >> x; return x; } ld PI = 3.14159265358979323846; ld eps = 1e-6; ll mod = 1e9 + 7;
	template<typename T> void Unique(T &a) {a.erase(unique(a.begin(), a.end()), a.end());}
	template<typename T1, typename T2> ostream& operator<<(ostream& out, const p<T1, T2>& x) {return out << x.f << ' ' << x.s;}
	template<typename T1, typename T2> istream& operator>>(istream& in, p<T1, T2>& x) {return in >> x.f >> x.s;}
	template<typename T> istream& operator>>(istream& in, vector<T>& a) {for(auto &x : a) in >> x; return in;};
	template<typename T> ostream& operator<<(ostream& out, vector<T>& a) {for(auto &x : a) out << x << ' '; return out;};
	template<typename T> istream& operator>>(istream& in, deque<T>& a) {for(auto &x : a) in >> x; return in;};
	template<typename T> ostream& operator<<(ostream& out, deque<T>& a) {for(auto &x : a) out << x << ' '; return out;};
	template<typename T> using ordered_set = tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>;
	template<typename T> using ordered_multiset = tree<T, null_type,less_equal<T>, rb_tree_tag,tree_order_statistics_node_update>;
	template<typename T> using pq = priority_queue<T>; template<typename T> using reverse_pq = priority_queue<T, vector<T>, greater<T> >;
	template<typename T> using matrix = vector<vector<T> >; template<typename T> using rubik = vector<vector<vector<T> > >;
	vector<ll> rdv(int sz) { vector<ll> x(sz); cin >> x;return x; }
	mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
	const int N = 1e6 + 5;
} // main template

void solve(){
	ll l = rd, r = rd;
	ll a = 0, b = 0;
	for (ll i = l; i <= r; i++){
		string s; cin >> s;
		if (s == "Fizz"){
			a = __gcd(a, i);
		} else if (s == "Buzz"){
			b = __gcd(b, i);
		} else if (s == "FizzBuzz"){
			a = __gcd(a, i);
			b = __gcd(b, i);
		}
	}
	cout << a << ' ' << b << '\n';
}

signed main(){
    cin.tie(0) -> ios::sync_with_stdio(false);
	for (int i = 1, j = 1; i > 0; i--, j++) {
		solve();
	}
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3404kb

input:

7 11
7 8 Fizz Buzz 11

output:

9 10

result:

ok 

Test #2:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

49999 50002
49999 FizzBuzz 50001 Fizz

output:

2 50000

result:

ok 

Test #3:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

8 11
Buzz Buzz FizzBuzz Buzz

output:

10 1

result:

ok 

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3472kb

input:

10 15
10 11 12 13 14 15

output:

0 0

result:

wrong answer Integer parameter [name=a] equals to 0, violates the range [1, 1000000]