結果
問題 |
No.257 N言っちゃダメゲーム (3)
|
ユーザー |
![]() |
提出日時 | 2015-07-31 23:10:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 744 bytes |
コンパイル時間 | 1,120 ms |
コンパイル使用メモリ | 82,496 KB |
実行使用メモリ | 43,688 KB |
最終ジャッジ日時 | 2024-07-16 20:57:08 |
合計ジャッジ時間 | 7,012 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:29:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 29 | scanf("%lld %lld", &n, &k); | ~~~~~^~~~~~~~~~~~~~~~~~~~~ main.cpp:32:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 32 | scanf("%lld", &n); | ~~~~~^~~~~~~~~~~~ main.cpp:39:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 39 | scanf("%lld", &r); | ~~~~~^~~~~~~~~~~~ main.cpp:44:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 44 | scanf("%lld", &r); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <algorithm> #include <vector> #include <cfloat> #include <string> #include <cmath> #include <set> #include <cstdlib> #include <map> #include <ctime> #include <iomanip> #include <functional> #include <deque> #include <iostream> #include <cstring> #include <queue> #include <cstdio> #include <stack> #include <climits> #include <sys/time.h> #include <cctype> using namespace std; typedef long long ll; int main() { ll n, k; scanf("%lld %lld", &n, &k); if (n-1 <= k) { printf("%lld\n", n-1); scanf("%lld", &n); return 0; } ll r = 0; if (n%(k+1) == 1) { puts("0"); scanf("%lld", &r); } ll p = (n-1)%(k+1); while (r < n) { printf("%lld\n", (r+k-p)/(k+1)*(k+1)+p); scanf("%lld", &r); } }