結果
| 問題 |
No.111 あばばばば
|
| コンテスト | |
| ユーザー |
TLwiegehtt
|
| 提出日時 | 2015-07-07 07:38:51 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 570 ms / 5,000 ms |
| コード長 | 360 bytes |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 20,224 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 01:28:54 |
| 合計ジャッジ時間 | 1,550 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &l);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
int i;
int a,b,l;
long long int cnt;
long long int ans=0; // unsigned 64bitをxに確保。
scanf("%d", &l);
a = (l/2)+1;
b = (l/2);
for(i=a,cnt=1;i>=2;i--,cnt++){
ans += cnt;
}
for(i=b,cnt=1;i>=2;i--,cnt++){
ans += cnt;
}
printf("%lld\n", ans); // 特殊な「 %I64u 」を使用する。
return 0;
}
TLwiegehtt