gravatar

385 problems solved
Rank by points: #35
Total points: 444

View submissions

13 contests written
Rank by rating: #52
Rating: 1841
Volatility: 65
Min. rating: 1505
Max rating: 1907

From William Lyon Mackenzie C.I., Olympiads School

About

Negative (and positive) fast integer scanning macro!


#define scan(x) do{while((_n=getchar())<45);if(_n-45)x=_n;else x=getchar();for(x-=48;47<(_=getchar());x=(x<<3)+(x<<1)+_-48);if(_n<46)x=-x;}while(0)
char _, _n;

User script that displays points per problem for all users under the other details. (deprecated)


// Adds a points per problem tag
// Add your username below in quotations
var username = "aurpine";

$(function() {
    var s = window.location.href;
    var xml = new XMLHttpRequest();
    xml.onreadystatechange = function() {
        if (xml.readyState == 4 && xml.status == 200) display(xml.responseText);
    };
    if(s === "https://dmoj.ca/user") xml.open("GET", "https://dmoj.ca/api/user/info/" + username, true);
    else if(s.substr(0, 21) === "https://dmoj.ca/user/" && s.substr(s.length - 7) === "/solved") xml.open("GET", "https://dmoj.ca/api/user/info/" + s.substr(21, s.length - 28), true);
    else if(s.substr(0, 21) === "https://dmoj.ca/user/") xml.open("GET", "https://dmoj.ca/api/user/info/" + s.substr(21), true);
    xml.send();
});

function display(text) {
    var a = JSON.parse(text).points;
    var b = parseInt(document.getElementsByTagName("h4")[0].innerHTML.split(" ")[0]);
    var bold = document.createElement("b");
    bold.appendChild(document.createTextNode("Points per problem:"));
    var box = document.getElementsByTagName("td")[0];
    var subs = box.getElementsByTagName("a")[0];
    box.appendChild(bold);
    box.insertBefore(bold, subs);
    var e2 = document.createTextNode(" " + (a / b).toFixed(2));
    box.appendChild(e2);
    box.insertBefore(e2, subs);
    var e3 = document.createElement("br");
    box.appendChild(e3);
    box.insertBefore(e3, subs);
}

Rating History

, #