結果
問題 | No.1052 電子機器X |
ユーザー |
![]() |
提出日時 | 2020-05-15 21:28:45 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 597 bytes |
コンパイル時間 | 1,463 ms |
コンパイル使用メモリ | 171,056 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-19 08:36:02 |
合計ジャッジ時間 | 3,797 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
10,752 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
ソースコード
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll n, k; cin >> n >> k; ll ans = 1; set<ll> a; rep(s, 0, 1<<k){ ans = 1; rep(i, 0, k){ if(s>>i&1){ if(ans == n) ans = 1; else ans++; } else{ if(ans == 1) ans = n; else ans--; } } //cout << ans << endl; a.insert(ans); } cout << a.size() << endl; return 0; }