제출 #399772

#제출 시각아이디문제언어결과실행 시간메모리
399772my99n철인 이종 경기 (APIO18_duathlon)C++14
0 / 100
1 ms332 KiB
#include<bits/stdc++.h>
using namespace std;

long long c (long long n) {
  return (n * n + n) >> 1;
}

long long solve (int n) {
  if (n == 3) return 1; 
  return solve(n-1) + c(n-2);
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m; cin >> n >> m;
  cout << 2*solve(n) << endl;
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...