結果
| 問題 |
No.442 和と積
|
| コンテスト | |
| ユーザー |
zawakasu
|
| 提出日時 | 2022-08-15 22:39:15 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,064 bytes |
| コンパイル時間 | 10,601 ms |
| コンパイル使用メモリ | 276,024 KB |
| 最終ジャッジ日時 | 2025-01-30 22:57:13 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
// #include <atcoder/modint>
// #include <atcoder/fenwicktree>
// #include <atcoder/segtree>
// #include <atcoder/scc>
#define all(x) begin(x), end(x)
using namespace std;
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
using i32 = int;
using i64 = long long;
void debug(vector<int> a) {
for (auto x : a) cout << x << ' ';
cout << endl;
}
void debug(vector<vector<int>> a) {
for (auto y : a) debug(y);
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b and (a = b, true);}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b and (a = b, true);}
const i64 supl = LONG_LONG_MAX - 100;
void main_() {
i64 a, b; cin >> a >> b;
i64 g = gcd(a, b);
a /= g;
b /= g;
cout << g * gcd(a + b, g) << endl;
}
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
main_();
return 0;
}
zawakasu