結果
| 問題 | No.152 貯金箱の消失 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-20 22:30:16 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 296 bytes |
| コンパイル時間 | 790 ms |
| コンパイル使用メモリ | 23,296 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-20 22:30:21 |
| 合計ジャッジ時間 | 1,387 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%d", &l);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int solve(int x, int y, int l) {
if (8 * x * (x + y) <= l) {
return (x + y) % 2 + solve(x + y, x, l) + solve(x + y, y, l);
}
else {
return 0;
}
}
int main() {
int l;
scanf("%d", &l);
printf("%d\n", solve(2, 1, l));
return 0;
}