結果
| 問題 |
No.72 そろばん Med
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2016-04-27 13:24:48 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 348 bytes |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-04 16:00:53 |
| 合計ジャッジ時間 | 1,264 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 23 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%lld",&n);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#define mod 1000007
int main(){
long long int i,j;
long long int n;
long long int ans;
long long int b,u;
scanf("%lld",&n);
if(n%2==1){
b=n/2+1;
u=n/2;
ans=(u*(b+1))%mod;
ans=ans+b;
}
else {
b=n/2;
u=n/2;
ans=(u*(b+1))%mod;
ans=ans+b;
}
printf("%lld\n",ans%mod);
return 0;
}
notetonous