結果

問題 No.72 そろばん Med
ユーザー goodbaton
提出日時 2014-11-20 23:09:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 409 bytes
コンパイル時間 633 ms
コンパイル使用メモリ 65,040 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 11:35:51
合計ジャッジ時間 1,596 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |     scanf("%lld",&n);
      |     ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;



int main(){
    long long n,a,sum;
    int mod = 1000007;
    
    scanf("%lld",&n);
    a=(n+1)/2%mod;
    n=n/2%mod;
    sum=a+a*n+n;
    
    printf("%lld\n",sum%mod);
    
    return 0;
}
0