Submission #9262038


Source Code Expand

Copy
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     @hamayanhamayan0
    /   \     | |
    /   / ̄ ̄ ̄ ̄/  |
  __(__ニつ/     _/ .| .|____
     \/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/














int N, A[30101][6];
double ma = 0;
double tot[30101];
double dp[181010];
vector<int> que[181010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) rep(j, 0, 6) cin >> A[i][j];

	vector<int> dic;
	dic.push_back(0);
	rep(i, 0, N) rep(j, 0, 6) dic.push_back(A[i][j]);
	sort(all(dic));
	dic.erase(unique(all(dic)), dic.end());

	int n = dic.size();
	rep(i, 0, N) rep(j, 0, 6) {
		int id = lower_bound(all(dic), A[i][j]) - dic.begin();
		que[id].push_back(i);
	}

	rrep(i, n - 1, 0) {
		dp[i] = ma + 1;
		fore(q, que[i]) {
			tot[q] += dp[i] / 6;
			chmax(ma, tot[q]);
		}
	}

	printf("%0.14f\n", dp[0]);
}





Submission Info

Submission Time
Task O - Endurance
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 6
Code Size 2014 Byte
Status AC
Exec Time 82 ms
Memory 13172 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 6 / 6
Status
AC × 2
AC × 23
Set Name Test Cases
Sample example_01.txt, example_02.txt
All example_01.txt, example_02.txt, subtask_01_01.txt, subtask_01_02.txt, subtask_01_03.txt, subtask_01_04.txt, subtask_01_05.txt, subtask_01_06.txt, subtask_01_07.txt, subtask_01_08.txt, subtask_01_09.txt, subtask_01_10.txt, subtask_01_11.txt, subtask_01_12.txt, subtask_01_13.txt, subtask_01_14.txt, subtask_01_15.txt, subtask_01_16.txt, subtask_01_17.txt, subtask_01_18.txt, subtask_01_19.txt, subtask_01_20.txt, subtask_01_21.txt
Case Name Status Exec Time Memory
example_01.txt AC 3 ms 6400 KB
example_02.txt AC 3 ms 6400 KB
subtask_01_01.txt AC 3 ms 6400 KB
subtask_01_02.txt AC 3 ms 6400 KB
subtask_01_03.txt AC 3 ms 6400 KB
subtask_01_04.txt AC 71 ms 12532 KB
subtask_01_05.txt AC 78 ms 13172 KB
subtask_01_06.txt AC 4 ms 6528 KB
subtask_01_07.txt AC 82 ms 13172 KB
subtask_01_08.txt AC 9 ms 7040 KB
subtask_01_09.txt AC 81 ms 13172 KB
subtask_01_10.txt AC 45 ms 11380 KB
subtask_01_11.txt AC 5 ms 6528 KB
subtask_01_12.txt AC 32 ms 9848 KB
subtask_01_13.txt AC 27 ms 9080 KB
subtask_01_14.txt AC 14 ms 7676 KB
subtask_01_15.txt AC 65 ms 13172 KB
subtask_01_16.txt AC 61 ms 13172 KB
subtask_01_17.txt AC 59 ms 13172 KB
subtask_01_18.txt AC 61 ms 13172 KB
subtask_01_19.txt AC 69 ms 13172 KB
subtask_01_20.txt AC 76 ms 13172 KB
subtask_01_21.txt AC 77 ms 13172 KB