結果
問題 | No.512 魔法少女の追いかけっこ |
ユーザー | naimonon77 |
提出日時 | 2017-07-16 20:36:12 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 3,275 bytes |
コンパイル時間 | 1,764 ms |
コンパイル使用メモリ | 173,016 KB |
実行使用メモリ | 6,656 KB |
最終ジャッジ日時 | 2024-06-27 06:36:02 |
合計ジャッジ時間 | 3,112 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 4 ms
6,528 KB |
testcase_01 | AC | 4 ms
6,528 KB |
testcase_02 | AC | 4 ms
6,656 KB |
testcase_03 | AC | 4 ms
6,528 KB |
testcase_04 | AC | 4 ms
6,528 KB |
testcase_05 | AC | 4 ms
6,528 KB |
testcase_06 | AC | 4 ms
6,528 KB |
testcase_07 | AC | 4 ms
6,528 KB |
testcase_08 | AC | 4 ms
6,528 KB |
testcase_09 | AC | 4 ms
6,528 KB |
testcase_10 | AC | 4 ms
6,528 KB |
testcase_11 | AC | 4 ms
6,528 KB |
testcase_12 | AC | 4 ms
6,528 KB |
testcase_13 | AC | 4 ms
6,528 KB |
testcase_14 | AC | 4 ms
6,528 KB |
testcase_15 | AC | 4 ms
6,528 KB |
testcase_16 | AC | 4 ms
6,528 KB |
testcase_17 | AC | 4 ms
6,528 KB |
testcase_18 | AC | 4 ms
6,528 KB |
testcase_19 | AC | 4 ms
6,528 KB |
testcase_20 | AC | 4 ms
6,528 KB |
testcase_21 | AC | 4 ms
6,528 KB |
testcase_22 | AC | 4 ms
6,528 KB |
testcase_23 | AC | 4 ms
6,528 KB |
testcase_24 | AC | 4 ms
6,528 KB |
testcase_25 | AC | 4 ms
6,528 KB |
testcase_26 | AC | 4 ms
6,656 KB |
testcase_27 | AC | 4 ms
6,528 KB |
testcase_28 | AC | 4 ms
6,528 KB |
testcase_29 | AC | 4 ms
6,528 KB |
testcase_30 | AC | 4 ms
6,528 KB |
testcase_31 | AC | 4 ms
6,528 KB |
testcase_32 | AC | 4 ms
6,528 KB |
testcase_33 | AC | 4 ms
6,528 KB |
testcase_34 | AC | 4 ms
6,528 KB |
testcase_35 | AC | 4 ms
6,528 KB |
testcase_36 | AC | 4 ms
6,656 KB |
testcase_37 | AC | 4 ms
6,528 KB |
testcase_38 | AC | 4 ms
6,528 KB |
testcase_39 | AC | 4 ms
6,400 KB |
testcase_40 | AC | 4 ms
6,528 KB |
testcase_41 | AC | 4 ms
6,656 KB |
testcase_42 | AC | 4 ms
6,528 KB |
testcase_43 | AC | 4 ms
6,528 KB |
testcase_44 | AC | 4 ms
6,528 KB |
testcase_45 | AC | 4 ms
6,528 KB |
testcase_46 | AC | 4 ms
6,528 KB |
testcase_47 | AC | 4 ms
6,528 KB |
testcase_48 | AC | 4 ms
6,528 KB |
testcase_49 | AC | 4 ms
6,528 KB |
testcase_50 | AC | 4 ms
6,528 KB |
testcase_51 | AC | 4 ms
6,528 KB |
testcase_52 | AC | 4 ms
6,528 KB |
ソースコード
#define TEST_MODE true #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rep2(i, a, b) for (int i = (a); i < (int)(b); ++i) #define rrep(i, n) for (int i = (n)-1; i >= 0; --i) #define rrep2(i, a, b) for (int i = (a)-1; i >= (int)b; --i) #define range(i, a, b, c) for (int i = a; \ c > 0 ? i < b : i > b; \ i += c) #define chmax(a, b) (a = (a) < (b) ? (b) : (a)) #define chmin(a, b) (a = (a) > (b) ? (b) : (a)) using ll = long long; using ull = unsigned long long; using ld = long double; #define all(a) begin(a), end(a) #define ifnot(a) if (not(a)) #define int long long #ifdef LOCAL_ENV #if TEST_MODE == true const bool test = true; #define dump(x) cerr << #x << " = " << (x) << endl #else const bool test = false; #define dump(x) #endif #else const bool test = false; #define dump(x) #endif int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; const int INF = (int)1 << 60; const ll INFL = (ll)1 << 60; ll mod_n = (int)1e9 + 7; const double eps = 1e-10; typedef long double Real; // return -1, 0, 1 int sgn(const Real &r) { return (r > eps) - (r < -eps); } int sgn(const Real &a, const Real &b) { return sgn(a - b); } //..................... const int MAX = (int)2e5 + 5; vector<string> split(const string &str, char sep) { vector<string> v; stringstream ss(str); string buffer; while (getline(ss, buffer, sep)) { v.push_back(buffer); } return v; } template <class InputIterator> int sum(InputIterator begin, InputIterator end) { return accumulate(begin, end, 0ll); } void solve(); class Solver { public: double X, Y; int N; double A[MAX]; double B[MAX]; void solve() { cin >> X >> Y; cin >> N; N++; A[0] = 0; rep2(i, 1, N) cin >> A[i]; rep(i, N) B[i] = A[i] / 3.6; bool ok = [&]() { rep(i, N-1) { dump(B[i] / X); dump(B[i+1] / Y); if (sgn(B[i] / X, B[i+1] / Y) == 1) { dump(i); return false; } } return true; }(); cout << (ok ? "YES" : "NO") << endl; } }; signed main() { cout << fixed << setprecision(20); auto ptr = new Solver(); ptr->solve(); delete ptr; // while (true) { // auto ptr = new Solver(); // ptr->solve(); // delete ptr; // } return 0; } // class Mycin { // bool flag = true; // public: // Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;} // Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;} // Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;} // operator bool() {return flag;} // } mycin; // class Mycout { // public: // Mycout& operator << (const int& a) {printf("%lld", a); return *this;} // Mycout& operator << (const char c) {printf("%c", c); return *this;} // Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;} // } mycout; // #define cin mycin // #define cout mycout // #define endl '\n'