結果
| 問題 | No.51 やる気の問題 |
| コンテスト | |
| ユーザー |
TLwiegehtt
|
| 提出日時 | 2015-07-07 03:57:27 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 376µs | |
| コード長 | 241 bytes |
| 記録 | |
| コンパイル時間 | 80 ms |
| コンパイル使用メモリ | 29,440 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-23 23:15:56 |
| 合計ジャッジ時間 | 1,520 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d", &w);
| ^~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &d);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main(void){
int i;
int d,w;
scanf("%d", &w);
scanf("%d", &d);
for(i=d;i>0;i--){
int out = (int)floor((w/i) /i);
if(i==1){
printf("%d\n", w);
break;
}
w -= out;
}
return 0;
}
TLwiegehtt