結果
| 問題 | No.72 そろばん Med |
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2016-04-27 13:27:37 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 360 bytes |
| 記録 | |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 29,000 KB |
| 最終ジャッジ日時 | 2026-02-23 21:09:56 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
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)%mod;
u=(n/2)%mod;
ans=u*(b+1);
ans=ans+b;
}
else {
b=(n/2)%mod;
u=(n/2)%mod;
ans=u*(b+1);
ans=ans+b;
}
printf("%lld\n",ans%mod);
return 0;
}
notetonous