結果
問題 |
No.906 Y字グラフ
|
ユーザー |
|
提出日時 | 2021-09-07 01:14:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 1,534 ms |
コンパイル使用メモリ | 165,268 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-22 20:34:11 |
合計ジャッジ時間 | 2,520 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
#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; ll R=N%6; ll Q=N/6; Q%=mod; cout<<((3*Q+R)*(Q+1)+(R==0))%mod<<endl; }