結果
問題 |
No.3003 多項式の割り算 〜hard〜
|
ユーザー |
|
提出日時 | 2025-01-26 13:14:44 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 729 bytes |
コンパイル時間 | 3,822 ms |
コンパイル使用メモリ | 312,092 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-26 13:14:50 |
合計ジャッジ時間 | 5,189 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
typedef long long ll; typedef long double ld; #include <bits/stdc++.h> using namespace std; // #define int long long #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template<typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>; // std::cout << *s.find_by_order(1) << std::endl; // 2 signed main(){ // これがないと落ちることがある ios_base::sync_with_stdio(false); cin.tie(0); ll a,b; cin >> a>>b; b%=3; vector<ll> c(b+1); c[b] = a; ll now = b; while(now-2>=0){ auto v = c[now]; c[now-1] -= v; c[now-2] -= v; now--; } cout << c[1]<<" "<<c[0] << endl; }