結果

問題 No.1624 三角形の反射
ユーザー 夜
提出日時 2021-08-06 17:58:56
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 771 ms
コンパイル使用メモリ 92,632 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 01:56:34
合計ジャッジ時間 2,874 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	long double a;
	cin >> a;
	for (long double i = 1;; i++) {
		if (a * i == floor(a * i)) {
			char ans;
			int ans1 = (a + 1) * i * 2 - 2 - (int((a + 1) * i) % 2) - i;
			if (int(abs(((a - 1) * i))) % 2 == 0) {
				ans = 'A';
			}
			else if (int(a * i) % 2 == 0) {
				ans = 'B';
			}
			else {
				ans = 'C';
			}
			cout << ans << " " << ans1 << endl;
			return 0;
		}
	}
}
0