結果
問題 | No.71 そろばん |
ユーザー |
![]() |
提出日時 | 2015-07-13 04:16:26 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 248 bytes |
コンパイル時間 | 161 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 06:25:42 |
合計ジャッジ時間 | 998 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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("%lld", &n); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ long long int d,n,u,tmp; long long int maxNum = 0; scanf("%lld", &n); for(d=0;d<=n;d++){ u = n-d; tmp = (d+1)*u+d; if(maxNum < tmp){ maxNum = tmp; } } printf("%lld\n", maxNum); return 0; }