結果
| 問題 |
No.71 そろばん
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2016-04-08 12:31:25 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 228 bytes |
| コンパイル時間 | 313 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 04:49:21 |
| 合計ジャッジ時間 | 1,380 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%lld",&n);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
long long int i,j;
long long int n;
long long int ans,max=0;
scanf("%lld",&n);
for(i=1;i<=n/2;i++){
ans=i+(i+1)*(n-i);
if(max<ans)max=ans;
}
printf("%lld\n",max);
return 0;
}
notetonous