-
-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fix first ac #969
Feature/fix first ac #969
Conversation
32a5e26
to
d87614b
Compare
34027ea
to
82f692e
Compare
82f692e
to
75f50cb
Compare
atcoder-problems-backend/sql-client/src/first_ac_submissions.rs
Outdated
Show resolved
Hide resolved
atcoder-problems-backend/sql-client/src/first_ac_submissions.rs
Outdated
Show resolved
Hide resolved
atcoder-problems-backend/sql-client/src/first_ac_submissions.rs
Outdated
Show resolved
Hide resolved
もしレビュー可能な状態になりましたら Ready for review みたいなボタンを押していただいても良いですか? |
d386c3a
to
dc46ff4
Compare
@kenkoooo |
atcoder-problems-backend/sql-client/src/first_ac_submissions.rs
Outdated
Show resolved
Hide resolved
atcoder-problems-backend/sql-client/src/first_ac_submissions.rs
Outdated
Show resolved
Hide resolved
レビュー対応はできましたが、ローカルで走らせてみると、abc196_aのFirst ACがmasterでは21059853だったのが、21059856になってしまいます。 |
atcoder-problems-backend/sql-client/src/first_ac_submissions.rs
Outdated
Show resolved
Hide resolved
ids.push(cur.id.clone()); | ||
problem_ids.push(cur.problem_id.clone()); | ||
contest_ids.push(cur.contest_id.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
たしか sqlx には Vec<&String>
あるいは Vec<&str>
を渡しても良かったはずです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error[E0277]: the trait bound `Vec<&std::string::String>: Type<Postgres>` is not satisfied
--> sql-client/src/first_ac_submissions.rs:47:19
|
47 | .bind(problem_ids)
| ^^^^^^^^^^^ the trait `Type<Postgres>` is not implemented for `Vec<&std::string::String>`
|
= help: the following implementations were found:
<Vec<&[u8]> as Type<Postgres>>
<Vec<&str> as Type<Postgres>>
<Vec<(T1, T2)> as Type<Postgres>>
<Vec<(T1, T2, T3)> as Type<Postgres>>
and 24 others
というコンパイルエラーが出て&String
は入れられないようです。submission_idは整数なので、clone記述はやめました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&strでもだめですか?
first_ac_submissionsのインターフェイスを修正しました。
この件はクロールがやりきれてなかったようで、クロールをやり直してbatch_updateするとmasterと同じ結果になりました。 |
そもそもこの「コンテスト中の提出のうち非参加者によるものは全て除く」というアイディアは First AC だけでなく Sortest や Fastest にも適用できるのではないですか? |
うーむ、ちゃんと仕様について相談すればよかったかもですね。 私が考えていたのは、shortestはコンテストに参加してなくても後でコードゴルフしてshortestにしたい人もいるため、shortestはコンテスト中もしくはコンテスト参加者に限らないのかなと思っていました。 どのsubmissionがx-estになるかの絞り方として、
という3つの考え方があるのですが、コンテスト中にほとんど決定されるfirstと違い、fastestとshortestで二番目の選択肢は違和感が大きいようにも思えます。 |
firstはコンテスト終了後(=解説公開後)はあまり意味が無い気がするので、本当はコンテスト期間中の提出に限った方がいいと思います。 |
x-est は次のように決めるものと考えています。
ここで、First は x=id, Shortest は x=length, Fastest は x=execution_time と考えます。 コンテスト中に解かれなかったような問題では解説を見てもACするのが大変かと思いますし、First AC がコンテスト後の提出でも意味がいないとはあまり思いません。 |
完全に理解できました! |
ただ、提出集合を
とした時に A ≠ B となるのは、writer/tester/admin がコンテスト中に提出し、かつ、それを公開設定にした場合のみなので、S3やLambdaやSQLにお金をかけてこのコーナーケースを取り除く必要があるかは未だによく分かっていません…… |
PRを作っておいてなんですが、これは私も微妙だなと思いました。 ここはkenkooooさんの判断でペンディングしてもらって構わないのです。 私としては結構勉強になったんで、このPRに取り掛かれたこと自体はよかったです。 |
ありがとうございます。せっかく作り込んでいただいたところ大変申し訳ないのですが、一旦様子見でいきましょう… |
いえいえ、色々とご助言ありがとうございました! |
まだ大分作りかけです。大分できてきました。
Resolves #899