結果

問題 No.63 ポッキーゲーム
ユーザー Tearon
提出日時 2016-09-03 23:59:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 175 ms / 5,000 ms
コード長 213 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 53,980 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 05:15:51
合計ジャッジ時間 1,712 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:29: warning: ‘cnt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   11 |                         yuu = (cnt - 1) * k;
      |                         ~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
	long l, k;
	cin >> l >> k;
	int cnt, yuu;
	while (1) {
		cnt ++;
		l -= 2 * k;
		if (l <= 0) {
			yuu = (cnt - 1) * k;
			break;
		} 
	}
	cout << yuu << endl;
}
0