結果
問題 | No.2600 Avator Height |
ユーザー | Ishan Manchanda |
提出日時 | 2024-01-12 21:30:15 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 5,029 bytes |
コンパイル時間 | 2,162 ms |
コンパイル使用メモリ | 203,000 KB |
実行使用メモリ | 7,424 KB |
最終ジャッジ日時 | 2024-09-27 21:20:20 |
合計ジャッジ時間 | 5,232 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
6,816 KB |
testcase_01 | AC | 38 ms
7,276 KB |
testcase_02 | AC | 38 ms
7,400 KB |
testcase_03 | AC | 40 ms
7,296 KB |
testcase_04 | AC | 38 ms
7,268 KB |
testcase_05 | AC | 38 ms
7,272 KB |
testcase_06 | AC | 40 ms
7,296 KB |
testcase_07 | AC | 37 ms
7,272 KB |
testcase_08 | AC | 38 ms
7,276 KB |
testcase_09 | AC | 41 ms
7,400 KB |
testcase_10 | AC | 40 ms
7,296 KB |
testcase_11 | AC | 40 ms
7,296 KB |
testcase_12 | AC | 38 ms
7,272 KB |
testcase_13 | AC | 40 ms
7,276 KB |
testcase_14 | AC | 39 ms
7,296 KB |
testcase_15 | AC | 40 ms
7,272 KB |
testcase_16 | AC | 40 ms
7,276 KB |
testcase_17 | AC | 38 ms
7,400 KB |
testcase_18 | AC | 41 ms
7,296 KB |
testcase_19 | AC | 41 ms
7,276 KB |
testcase_20 | AC | 42 ms
7,268 KB |
testcase_21 | AC | 42 ms
7,424 KB |
testcase_22 | AC | 42 ms
7,296 KB |
testcase_23 | AC | 43 ms
7,400 KB |
testcase_24 | AC | 26 ms
7,268 KB |
testcase_25 | AC | 39 ms
7,296 KB |
ソースコード
//#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx,avx2,fma,tune=native") //#pragma GCC target("avx,avx2,fma") //#pragma GCC target("tune=native") #include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define all(x) begin(x), end(x) #define rall(x) (x).rbegin(), (x).rend() #define PB emplace_back #define MP make_pair #define MT make_tuple #define REP(i, a, b) for (ll i = (a); i < (b); ++i) #define RREP(i, a, b) for (ll i = (a); i > (b); --i) #define cinai(a, n) REP(ii, 0, n) cin >> a[ii] #define cinani(a, n) int n; cin >> n; int a[n]; cinai(a, n) #define cinan(a, n) ll n; cin >> n; ll a[n]; cinai(a, n) #define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); #define FILE_IN freopen("input.txt", "r", stdin); #define FILE_OUT freopen("output.txt", "w", stdout); #define TESTCASES ll tt; cin >> tt; while (tt--) #define TESTCASES1 ll tt; cin >> tt; REP(ttt, 1, tt + 1) #define CASEOUT cout << "Case #" << ttt << ": " #define NEG_INF (-LLONG_MAX) #define FLOAT_EQ(a, b) (abs((a) - (b)) < 1e-9) #define MOD (1'000'000'007) //#define MOD_SUM(a, b) ((a) + (b) >= MOD) ? ((a) + (b) - MOD) : ((a) + (b)) #define endl "\n"; #define debarr(a,n) cout<<#a<<" : ";for(int i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl; #define debmat(mat,row,col) cout<<#mat<<" :\n";for(int i=0;i<row;i++) {for(int j=0;j<col;j++) cerr<<mat[i][j]<<" ";cerr<<endl;} #define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__) template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ") ";} template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "] ";} template <class T>ostream& operator <<(ostream& os, const unordered_set<T>& p) {os << "{ "; for (auto& it : p) os << it << " "; return os << "} ";} template <class S, class T>ostream& operator <<(ostream& os, const unordered_map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "] ";} template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "{ "; for (auto& it : p) os << it << " "; return os << "} ";} template <class T>ostream& operator <<(ostream& os, const multiset<T>& p) {os << "{{ "; for (auto& it : p) os << it << " "; return os << "}} ";} template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "] ";} template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";} template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ","; dbs(str.substr(idx + 1), s...);} template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";} //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; //typedef tree<int, null_type, less<int>, rb_tree_tag, // tree_order_statistics_node_update> indexed_set; /* find_by_order(k) and order_of_key(x) */ //#include <ext/rope> //using namespace __gnu_cxx; //rope<int> v1; // can use as usual STL container // v1.push_back(x), v1.erase(start, len) // v2 = v1.substr(l, r - l + 1) // v.insert(v.mutable_begin() + idx, v2) // auto it = v.mutable_begin(); it != v.mutable_end(); it++ // can index using [ ] to return const ref // modify: v.mutable_reference_at(i) = x //#include <ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; //gp_hash_table<int, int> table; // can use any other type as key if defined a hash function //struct chash { // int operator()(pi x) const { return x.first * 31 + x.second; } //}; //gp_hash_table<pi, int, chash> table; typedef long long ll; typedef unsigned long long ull; //typedef __int128_t lll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef tuple<int, int, int> ti; typedef vector<int> vi; typedef vector<pi> vpi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<vl> vvl; // x^y mod m in O(log y) ll bin_exp_mod(ll x, ll y, ll m) { x %= m; ll ans = 1LL; while (y) { if (y & 1) ans = (ans * x) % m; x = (x * x) % m; y >>= 1; } return ans; } ll r[200006], e[200006]; int main() { FAST_IO // FILE_IN // FILE_OUT // cout << setprecision(11); string problem_name = "gymnastics"; #define NEW_PROBLEM #ifndef LOCAL_RIPPR #ifndef NEW_PROBLEM freopen((problem_name + ".in").c_str(), "r", stdin); freopen((problem_name + ".out").c_str(), "w", stdout); #endif #endif // TESTCASES {} ll mod = 998244353; int n; cin >> n; int a[n]; cinai(a, n); r[0] = r[1] = e[0] = 1, e[1] = 3; REP(i, 2, 200003) r[i] = (r[i - 1] + r[i - 2]) % mod, e[i] = (e[i - 1] + e[i - 2]) % mod; for (auto x : a) cout << (5 * ((r[x - 1] * r[x - 1]) % mod) - ((e[x - 1] * e[x - 1]) % mod) + mod) % mod << endl; cout << flush; }