結果

問題 No.51 やる気の問題
ユーザー suppy193
提出日時 2015-05-27 15:30:31
言語 C90
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 209 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 10:59:53
合計ジャッジ時間 1,851 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 RE * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d", &W);
      |         ^~~~~~~~~~~~~~~
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d", &D);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

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