Tags » Histogram

Mirror, mirror … the best batsman of them all?

“Full many a gem of purest serene
The dark oceans of cave bear.”
Thomas Gray – Elegy in country churchyard

In this post I do a fine grained analysis of the batting performances of cricketing icons from India and also from the international scene to determine how they stack up against each other.  1,067 more words

Technology

Part 4: The language of light - Project 1: Exposure

Exercise 4.1 Exposure

For this exercise I’m to take two sets of three shots with the first set in auto or a semi-auto mode, and the second set in manual mode. 622 more words

Aperture Priority

Statistics: The Basics

Statistics is the study of the collection, organization, analysis, interpretation and presentation of data (wikipedia). To this end some averages (the middle) and standard deviations (the variation from the middle) are some of the basic calculations in statistics which we use every day.  339 more words

CGMP & QC

Visualising Solar Generation Data in a Custom Histogram using D3.js

Using the “brush” feature of the D3 Javascript library again proves handy for creating an interactive, animated histogram.  This type of visualisation helps to analyse and explore the distribution of time-series data. 338 more words

CSV

Light OJ 1083 - Histogram


/*
Link: http://www.lightoj.com/volume_showproblem.php?problem=1083
*/

#include <bits/stdc++.h>

#define pii pair <int,int>
#define sc scanf
#define pf printf
#define Pi 2*acos(0.0)
#define ms(a,b) memset(a, b, sizeof(a))
#define pb(a) push_back(a)
#define MP make_pair
#define oo 1<<29
#define dd double
#define ll long long
#define EPS 10E-10
#define ff first
#define ss second
#define MAX 10000
#define SZ(a) (int)a.size()
#define getint(a) scanf("%d",&a)
#define loop(i,n) for(int i=0;i<n;i++)
#define TEST_CASE(t) for(int z=1;z<=t;z++)
#define PRINT_CASE printf("Case %d: ",z)
#define all(a) a.begin(),a.end()
#define intlim 2147483648
#define inf 1000000
#define rtintlim 46340
#define llim 9223372036854775808
#define rtllim 3037000499
#define ull unsigned long long
#define I int

using namespace std;
int ara;
int n;
ll histogram()
{
    stack<int>st;
    ll ans=0;
    int i=0;
    while(i<n)
    {
        if(st.empty() || ara<=ara[i])
            st.push(i++);
        else
        {
            int top=st.top();
            st.pop();
            ll top_area=ara*(st.empty()?i:i-st.top()-1);
            ans=max(ans,top_area);
        }
    }
    while(!st.empty())
    {
        int top=st.top();
        st.pop();
        ll top_area=ara*(st.empty()?i:i-st.top()-1);
        ans=max(ans,top_area);
    }
    return ans;
}

int main()
{
    ///freopen("in.txt","r",stdin);
    ///freopen("out.txt","w",stdout);
    int t;
    getint(t);
    TEST_CASE(t)
    {

        getint(n);
        loop(i,n)
        sc("%d",&ara[i]);
        PRINT_CASE;
        pf("%lld\n",histogram());
    }
    return 0;
}


Light OJ

Univariate, Bivariate and Multivariate Datasets

In the earlier post, I avoided using the term “variable” to keep you out of confusion until I explained what is meant by the term… 250 more words

Prerequisites

Kernel density estimates

In the senior thesis writing course, I suggested to the class that they replace the histograms that several students were using with kernel density estimates… 873 more words