結果
問題 | No.1292 パタパタ三角形 |
ユーザー | k |
提出日時 | 2021-02-08 23:22:18 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 1,001 bytes |
コンパイル時間 | 2,325 ms |
コンパイル使用メモリ | 209,952 KB |
実行使用メモリ | 22,128 KB |
最終ジャッジ日時 | 2023-09-20 08:07:34 |
合計ジャッジ時間 | 4,465 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 2 ms
4,376 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 1 ms
4,376 KB |
testcase_07 | AC | 39 ms
7,292 KB |
testcase_08 | AC | 38 ms
7,012 KB |
testcase_09 | AC | 73 ms
21,308 KB |
testcase_10 | AC | 74 ms
21,244 KB |
testcase_11 | AC | 74 ms
21,004 KB |
testcase_12 | AC | 82 ms
22,128 KB |
testcase_13 | AC | 82 ms
22,124 KB |
testcase_14 | AC | 7 ms
4,380 KB |
testcase_15 | AC | 8 ms
4,376 KB |
testcase_16 | AC | 7 ms
4,376 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; class point { double x; double y; public: point(double x, double y) { this->x = x; this->y = y; } point() { this->x = 0; this->y = 0; } point operator+(const point &p) const { return point(x + p.x, y + p.y); } point operator-(const point &p) const { return point(x - p.x, y - p.y); } bool operator<(const point &p) const { if (this->x != p.x) return this->x < p.x; return this->y < p.y; } }; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; tuple<point, point, point> cur(point(0, 0.5), point(0, 0), point(1, 0)); set<tuple<point, point, point> > t; t.insert(cur); for (char c: s) { point A, B, C; tie(A, B, C) = cur; if (c == 'a') A = B + C - A; else if (c == 'b') B = C + A - B; else C = A + B - C; cur = tuple(A, B, C); t.insert(cur); } cout << t.size() << endl; return 0; }