QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#246604 | #5158. Interview Question | thanhchauns2# | WA | 1ms | 3496kb | C++20 | 2.8kb | 2023-11-10 22:51:35 | 2023-11-10 22:51:36 |
Judging History
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();
}
}
Details
Tip: Click on the bar to expand more detailed information
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]