結果
問題 | No.2241 Reach 1 |
ユーザー |
![]() |
提出日時 | 2023-05-05 22:29:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 405 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 40,644 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-23 09:19:22 |
合計ジャッジ時間 | 1,595 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
/* -*- coding: utf-8 -*- * * 2241.cc: No.2241 Reach 1 - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); int bn = 0; for (int k = n; k > 0; k >>= 1) bn += (k & 1); int x = (bn == 1) ? 1 : (n & 1) ? 2 : 3; printf("%d\n", x); return 0; }