CodeForces Print Helper

Help you to print complete problemset from CodeForces with only 1 column

  1. // ==UserScript==
  2. // @name CodeForces Print Helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.1
  5. // @description Help you to print complete problemset from CodeForces with only 1 column
  6. // @author SaoJiaFei
  7. // @match https://codeforces.com/contest/*/problems
  8. // @match https://codeforces.com/gym/*/problems
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=codeforces.com
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. function addGlobalStyle(css) {
  15. // Copy from: https://stackoverflow.com/a/46285637
  16. var head, style;
  17. head = document.getElementsByTagName('head')[0];
  18. if (!head) { return; }
  19. style = document.createElement('style');
  20. style.type = 'text/css';
  21. style.innerHTML = css.replace(/;/g, ' !important;');
  22. head.appendChild(style);
  23. }
  24. (function() {
  25. 'use strict';
  26. addGlobalStyle('.compact-problemset .problem-frames { column-count: 1; }');
  27. })();