結果

問題 No.51 やる気の問題
コンテスト
ユーザー suppy193
提出日時 2015-06-03 14:15:04
言語 C90
(gcc 12.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 239 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 62 ms
コンパイル使用メモリ 21,576 KB
最終ジャッジ日時 2026-01-04 20:48:54
合計ジャッジ時間 509 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:17: error: C++ style comments are not allowed in ISO C90
    8 |                 //printf("%d %d\n", W, W / i / i);
      |                 ^
main.c:8:17: note: (this will be reported only once per input file)
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d", &W);
      |         ^~~~~~~~~~~~~~~
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d", &D);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>

int main(void) {
	int i, W, D;
	scanf("%d", &W);
	scanf("%d", &D);
	for(i = D;i > 0;i--){
		//printf("%d %d\n", W, W / i / i);
		if(W <= W / i / i){
			break;
		}
		W -= W / i / i;
	}
	printf("%d\n", W);
	
	return 0;
}
0