結果
| 問題 |
No.80 四角形を描こう
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2016-04-28 21:19:17 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 258 bytes |
| コンパイル時間 | 327 ms |
| コンパイル使用メモリ | 20,608 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 05:05:26 |
| 合計ジャッジ時間 | 1,176 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 |
コンパイルメッセージ
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("%d",&d);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int d;
int i;
int max=0,s=0;
scanf("%d",&d);
if(d<4){
printf("0\n");
return 0;
}
if(d%2==1)d=d--;
d=d/2;
for(i=1;i<=d/2;i++){
s=i*(d-i);
if(s>max)max=s;
}
printf("%d\n",max);
return 0;
}
notetonous