제출 #109298

#제출 시각아이디문제언어결과실행 시간메모리
109298b2563125Gap (APIO16_gap)C++14
30 / 100
72 ms3580 KiB
#include<iostream> #include<algorithm> #include<vector> #include "gap.h" using namespace std; #define ll long long #define vel vector<long long> #define rep(i,n) for(int i=0;i<n;i++) int pr = 1000000007; int ref(int &a) { a = a % pr; a += pr; a = a % pr; return a; } ll findGap(int t, int n) { vel a(n); ll mn = 0; ll mx = (pr - 7); mx *= mx; rep(i, (n + 1) / 2) { MinMax(mn, mx, &mn, &mx); a[i] = mn; a[n - 1 - i] = mx; mn++; mx--; } ll ans = 0; rep(i, n - 1) { ans = max(ans, a[i + 1] - a[i]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...