結果
問題 | No.229 線分上を往復する3つの動点の一致 |
ユーザー | Kmcode1 |
提出日時 | 2015-06-19 23:39:01 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 7,223 bytes |
コンパイル時間 | 1,142 ms |
コンパイル使用メモリ | 119,420 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-07 04:23:04 |
合計ジャッジ時間 | 2,161 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:340:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 340 | 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; } long long int ppow(long long int i, long long int j){ long long int res = 1LL; while (j){ if (j & 1LL){ res *= i; res %= MOD; } i *= i; i %= MOD; j >>= 1LL; } return res; } long long int extgcd(long long int a, long long int b, long long int &x, long long int &y){ long long int d = a; if (b != 0){ d = extgcd(b, a%b, y, x); y -= (a / b)*x; } else{ x = 1; y = 0; } return d; } long long int modinverse(long long int a, long long int b){ //aの逆元を求める(mod b) long long int x, y; long long int d = extgcd(a, b, x, y); return (x%b + b) % b; } namespace matrix{ vector<vector<long long int> > mul(vector<vector<long long int> > &a, vector<vector<long long int> > &b){ vector<vector<long long int> > c(a.size(), vector<long long int>(b[0].size())); for (int i = 0; i < a.size(); i++){ for (int j = 0; j < b.size(); j++){ for (int k = 0; k < b[0].size(); k++){ c[i][k] = (c[i][k] + a[i][j] * b[j][k]); c[i][k] %= MOD; } } } return c; } vector<vector<long long int> > ppow(vector<vector<long long int> > a, long long int n){ vector<vector<long long int> > b = a; if (n == 1LL){ return b; } n--; while (n){ if ((n & 1LL)){ b = mul(b, a); } a = mul(a, a); n >>= 1LL; } return b; } } namespace fibonacci{ /* index :1,2,3,4,5,6, number:1,1,2,3,5,8, */ vector<vector<long long int> > mat; long long int get_fibonacci(long long int a){ //indexed from 1 if (a == 0LL){ return 1LL; } if (a == 1LL){ return 1LL; } if (a == 2LL){ return 1LL; } math::fibonacci::mat.clear(); math::fibonacci::mat.assign(2, vector<long long int>(2, 0)); math::fibonacci::mat[1][0] = 1LL; math::fibonacci::mat[0][1] = 1LL; math::fibonacci::mat[1][1] = 1LL; math::fibonacci::mat = math::matrix::ppow(mat, a - 2LL); long long int r = math::fibonacci::mat[0][1]; r += mat[1][1]; r %= MOD; return r; } } namespace factorial{ vector<long long int> lo; vector<double> l2; void set_long(long long int b){ if (lo.size()){ } else{ lo.push_back(1); } for (long long int i = lo.size(); i <= b; i++){ lo.push_back(lo.back()); lo.back() *= i; if (lo.back() >= MOD){ lo.back() %= MOD; } } } void set_log(long long int b){ if (l2.size()){ } else{ l2.push_back(log(0.0)); } for (long long int i = l2.size(); i <= b; i++){ l2.push_back(l2.back()); l2.back() += log((double)(i)); } } long long int get_long(int b){ if (lo.size() <= b){ set_long(b); } return lo[b]; } double get_log(int b){ if (l2.size() <= b){ set_log(b); } return l2[b]; } } namespace combination{ long long int simpleC(long long int a, long long int b){ if (a < b){ return 0; } if (a - b < b){ b = a - b; } long long int u = 1LL; for (long long int j = a; j >= a - b + 1LL; j--){ u *= j; if (u >= MOD){ u %= MOD; } } long long int s = 1LL; for (long long int i = 1LL; i <= b; i++){ s *= i; if (s >= MOD){ s %= MOD; } } return (u*ppow(s, MOD - 2)) % MOD; } long long int C(long long int a, long long int b){ if (a < b){ return 0; } long long int u = math::factorial::get_long(a); long long int s = math::factorial::get_long(b)*math::factorial::get_long(a - b); u %= MOD; s %= MOD; return (u*ppow(s, MOD - 2)) % MOD; } double logC(int a, int b){ double u = math::factorial::get_log(a); double s = math::factorial::get_log(b) + math::factorial::get_log(a - b); return u - s; } long long int H(long long int a, long long int b){ return math::combination::C(a + b - 1LL, b); } long long int simpleH(long long int a, long long int b){ return math::combination::simpleC(a + b - 1LL, b); } } namespace prime{ vector<long long int> prime; vector<long long int> use; //smallest divisor void init(int b){ use.assign(b + 1, 0); prime.clear(); prime.push_back(2); use[2] = 2; for (int i = 3; i < use.size(); i += 2){ if (use[i] == 0LL){ prime.push_back(i); use[i] = i; for (int j = i * 2; j < use.size(); j += i){ use[j] = i; } } } } vector<int> factorizetion(long long int num){ vector<int> r; r.clear(); for (int i = 0; i<prime.size() && prime[i] * prime[i] <= num; i++){ while (num%prime[i] == 0LL){ r.push_back(prime[i]); num /= prime[i]; } } if (num > 1LL){ r.push_back(num); } return r; } int size_of_factorization(long long int num){ int cnt = 0; for (int i = 0; i<prime.size() && prime[i] * prime[i] <= num; i++){ while (num%prime[i] == 0LL){ cnt++; num /= prime[i]; } } if (num > 1LL){ cnt++; } return cnt; } long long int number_of_div(long long int num){ long long int way = 1LL; long long int cnt = 0; for (int i = 0; i < prime.size() && prime[i] * prime[i] <= num; i++){ cnt = 0; while (num%prime[i] == 0){ cnt++; num /= prime[i]; } way *= (cnt + 1LL); } if (num > 1LL){ way *= 2LL; } return way; } bool isprime(int b){ return binary_search(prime.begin(), prime.end(), b); } bool bruteprime(long long int b){ for (long long int i = 2; i*i <= b; i++){ if (b%i == 0LL){ return true; } } return false; } } } 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; } st div(st a, st b){ swap(b.s, b.u); return mul(a, b); } st pluss(st a, st b){ long long int k = lcm(a.s, b.s); a.u *= k / a.s; b.u *= k / b.s; a.s = b.s = k; a.u += b.u; y(a); return a; } vector<int> v; vector<st> vv; st A(st a,st b){ st k2 = st(1, 1); st p = pluss(a, b); p = div(st(1, 1), p); y(p); return p; } 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; }