question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

download: no samples found in AtCoder tenka1_2014_qualA_e

See original GitHub issue

oj d fails for https://atcoder.jp/contests/tenka1-2014-quala/tasks/tenka1_2014_qualA_b and https://atcoder.jp/contests/tenka1-2014-quala/tasks/tenka1_2014_qualA_e without making corrupted files.

嘘を出力するわけではないのであまり深刻ではないが、AtCoder 側の JavaScript はきちんと認識しているのでたぶん直せるし直しておくべき

$ oj d https://atcoder.jp/contests/tenka1-2014-quala/tasks/tenka1_2014_qualA_e       [x] problem recognized: AtCoderProblem.from_url('https://atcoder.jp/contests/tenka1-2014-quala/tasks/tenka1_2014_qualA_e'): https://atcoder.jp/contests/tenka1-2014-quala/tasks/tenka1_2014_qualA_e
[x] load cookie from: /home/ubuntu/.local/share/online-judge-tools/cookie.jar
[x] GET: https://atcoder.jp/contests/tenka1-2014-quala/tasks/tenka1_2014_qualA_e
[x] 200 OK
[x] save cookie to: /home/ubuntu/.local/share/online-judge-tools/cookie.jar
[x] append history to: /home/ubuntu/.cache/online-judge-tools/download-history.jsonl

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kmykcommented, Nov 21, 2019

自分に assign しました。

1reaction
kmykcommented, Nov 20, 2019

その方針でも解決はできるので悪くはなさそう (プルリクが来たらマージはする) ですが、なんとなく筋が悪い気がします。 というのも、今回のものは AtCoder 本体が使用している JavaScript はサンプルの認識に成功しているためです。これに倣って以下の h3+section pre を判定していることろを消して pre.prettyprint を用いる形で解決したいです。これは変更量が大きいので不安ですが、AtCoder 公式に併せておいた方が長期的には安全に思われます。

ちなみに申し訳ないことに、現状なぜ AtCoder の JavaScript に従った実装になっていないかは記憶にないです。当時は Copy ボタンが存在していなかったか、単に下手をやったかのどちらかでしょう。

https://github.com/kmyk/online-judge-tools/blob/00adee25ed70b53bbe535f2772d4758022205348/onlinejudge/service/atcoder.py#L653-L654


参考

現状の実装

https://github.com/kmyk/online-judge-tools/blob/00adee25ed70b53bbe535f2772d4758022205348/onlinejudge/service/atcoder.py#L636-L685

AtCoder 側の JavaScript https://atcoder.jp/public/js/contest.js?v=201911110917

  // copy button
  if (document.queryCommandSupported('copy') && (typeof PRINT === 'undefined')) {
    $("#task-statement h3+pre").each(function(i){
      var id = "pre-sample"+i;
      $(this).attr("id", id);
      var h3 = $(this).prev('h3');
      h3.append(' <span class="btn btn-default btn-sm btn-copy" tabindex="0" data-toggle="tooltip" data-trigger="manual" title="Copied!" data-target="'+id+'">Copy</span>');
      $(this).before('<div class="div-btn-copy"><span class="btn-copy btn-pre" tabindex="0" data-toggle="tooltip" data-trigger="manual" title="Copied!" data-target="'+id+'">Copy</span></div>');
    });
    var cnt = 0;
    $('pre.prettyprint').each(function() {
      var pre_id = "for_copy"+cnt;
      var btn_html = '<div class="div-btn-copy"><span class="btn-copy btn-pre" tabindex="0" data-toggle="tooltip" data-trigger="manual" title="Copied!" data-target="'+pre_id+'">Copy</span></div>';
      $(this).before(btn_html);
      $(this).addClass('source-code');
      var for_copy_html = '<pre id="'+pre_id+'" class="source-code-for-copy"></pre>';
      $(this).after($(for_copy_html).text($(this).text()));
      cnt++;
    });
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Testcases of AtCoder - Codeforces
However, I found it little inconvenient or strange to search "Testcases of Atcoder" in google, go to Codeforces, and download test datas there....
Read more >
A - Find Multiple - AtCoder
Problem Statement. Print a number between A A A and B B B (inclusive) that is a multiple of C C C ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found