結果

問題 No.906 Y字グラフ
ユーザー karinohitokarinohito
提出日時 2021-09-07 01:11:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 1,527 ms
コンパイル使用メモリ 165,584 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-22 20:34:07
合計ジャッジ時間 2,719 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<ll>>;
ll mod=1e9+7;

int main() {
    ll N;
    cin>>N;
    N-=4;
    
    if(N%6==0){
      cout<<(3*(((N/6)%mod)*(N/6+1)%mod)+1)%mod<<endl;
    }
    else{
      cout<<(((N/6*3)%mod+N%6)*((N/6)%mod+1))%mod<<endl;
    }
}
0