結果
問題 |
No.477 MVP
|
ユーザー |
![]() |
提出日時 | 2018-08-18 14:41:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 363 bytes |
コンパイル時間 | 590 ms |
コンパイル使用メモリ | 50,108 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 13:59:22 |
合計ジャッジ時間 | 888 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:13:17: warning: format ‘%u’ expects argument of type ‘unsigned int*’, but argument 2 has type ‘long int*’ [-Wformat=] 13 | scanf("%u %u", &N, &K); | ~^ ~~ | | | | | long int* | unsigned int* | %lu main.cpp:13:20: warning: format ‘%u’ expects argument of type ‘unsigned int*’, but argument 3 has type ‘long int*’ [-Wformat=] 13 | scanf("%u %u", &N, &K); | ~^ ~~ | | | | | long int* | unsigned int* | %lu main.cpp:16:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 16 | printf("%d", i); | ~^ ~ | | | | int long int | %ld main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%u %u", &N, &K); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio> #include <vector> #include <map> #include <algorithm> #include <cmath> #define rep(i,N) for(int (i)=0;(i)<(N);(i)++) using namespace std; int main(){ long int N, K; scanf("%u %u", &N, &K); for (long int i = ceil((N-K)/(K+1)); i < N/2+2; i++) { if (i > (long int) floor((N - i) / K)) { printf("%d", i); return 0; } } return 0; }