結果
問題 | No.1052 電子機器X |
ユーザー |
![]() |
提出日時 | 2020-05-15 21:28:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.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 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 15 |
ソースコード
#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;}