結果

問題 No.63 ポッキーゲーム
ユーザー 184184
提出日時 2014-11-11 23:36:50
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 336 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 63,536 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 04:41:18
合計ジャッジ時間 1,313 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         int n,k;scanf("%d%d",&n,&k);
      |                 ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>  
#include <iostream>
#include <vector>
#include <string>
#include <algorithm> 
#include <map>

using namespace std;
//namaega184
//開催時間がきつい・・・
int main(){
	int n,k;scanf("%d%d",&n,&k);
	int a=(n+k-1)/k;  
	printf("%d\n",k*(a-(a+1)/2-(a%2?0:1)));
	return 0;
}
0