結果
問題 |
No.229 線分上を往復する3つの動点の一致
|
ユーザー |
![]() |
提出日時 | 2015-06-19 23:47:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,448 bytes |
コンパイル時間 | 870 ms |
コンパイル使用メモリ | 100,220 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 04:27:38 |
合計ジャッジ時間 | 2,098 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:71:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 71 | scanf("%d", &a); | ~~~~~^~~~~~~~~~
ソースコード
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cctype> #include<cstdlib> #include<algorithm> #include<bitset> #include<vector> #include<list> #include<deque> #include<queue> #include<map> #include<set> #include<stack> #include<cmath> #include<sstream> #include<fstream> #include<iomanip> #include<ctime> #include<complex> #include<functional> #include<climits> #include<cassert> #include<iterator> #include<unordered_map> using namespace std; #define MOD 1000000007 namespace math{ long long int gcd(long long int a, long long int b){ if (a > b){ swap(a, b); } while (a){ swap(a, b); a %= b; } return b; } long long int lcm(long long int a, long long int b){ long long int g =gcd(a, b); a /= g; return a*b; } } using namespace math; struct st{ long long int u; long long int s; st(long long int u_ = 0,long long int s_=0){ u = u_; s = s_; } }; void y(st &a){ long long int g = gcd(a.s, a.u); a.s /= g; a.u /= g; } st mul(st a, st b){ st s; s.s = a.s*b.s; s.u = a.u*b.u; y(s); return s; } vector<long long int> v; int main(){ for (int i = 0; i < 3; i++){ int a; scanf("%d", &a); v.push_back(a); } sort(v.begin(), v.end()); st k = st(v[0] * v[1] * (v[1] + v[2]), (v[2] + v[1])*(v[0] + v[1])); st kk = st(v[2] * v[1] * (v[1] + v[0]), (v[2] + v[1])*(v[0] + v[1])); long long int B = lcm(k.u, kk.u); k.u = B; y(k); printf("%lld/%lld\n", k.u, k.s); return 0; }