at_coder_friends 0.6.5 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitattributes +1 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/ruby.yml +32 -0
- data/.rubocop.yml +10 -2
- data/.travis.yml +1 -3
- data/CHANGELOG.md +27 -0
- data/Gemfile.lock +58 -50
- data/README.md +6 -2
- data/at_coder_friends.gemspec +5 -6
- data/docs/CONFIGURATION.md +8 -64
- data/lib/at_coder_friends/cli.rb +9 -1
- data/lib/at_coder_friends/config_loader.rb +2 -3
- data/lib/at_coder_friends/generator/base.rb +1 -1
- data/lib/at_coder_friends/generator/cxx_builtin.rb +1 -2
- data/lib/at_coder_friends/generator/main.rb +7 -8
- data/lib/at_coder_friends/generator/ruby_builtin.rb +2 -3
- data/lib/at_coder_friends/parser/binary.rb +3 -2
- data/lib/at_coder_friends/parser/constraints.rb +1 -0
- data/lib/at_coder_friends/parser/input_format.rb +14 -8
- data/lib/at_coder_friends/parser/input_type.rb +3 -2
- data/lib/at_coder_friends/parser/modulo.rb +5 -7
- data/lib/at_coder_friends/parser/section_wrapper.rb +3 -5
- data/lib/at_coder_friends/parser/sections.rb +5 -5
- data/lib/at_coder_friends/problem.rb +1 -1
- data/lib/at_coder_friends/scraping/agent.rb +1 -1
- data/lib/at_coder_friends/scraping/authentication.rb +3 -3
- data/lib/at_coder_friends/scraping/submission.rb +1 -1
- data/lib/at_coder_friends/scraping/tasks.rb +3 -0
- data/lib/at_coder_friends/test_runner/base.rb +1 -2
- data/lib/at_coder_friends/test_runner/judge.rb +3 -3
- data/lib/at_coder_friends/version.rb +1 -1
- data/templates/cxx_builtin.cxx.erb +29 -42
- data/templates/ruby_builtin.rb.erb +19 -21
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc8c9e5d2e8f2f243d7e520c88186cc62b46296a3e1b5d7a60673d8a208dd7ec
|
4
|
+
data.tar.gz: 732ab4cbadae2e8e8a1a51e3928fc0bb7f58da4738c770c93d82f5b6262f76b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df86a0c84321098080ba9ad9ef32b6b8f413621ecd90c297fc27d65f36d8d159e7cbfe03c54cce0aa9560ce2b33841c9afa46eb5fbff33bb977d3c0dcfb186bb
|
7
|
+
data.tar.gz: fbc249260ea37187c833ff102002feee9781dc6eecdfd175d4fd06ccf3f33d7a706431353c39a4126d9761825f50b3050b695b02353558594ef93ab07a4dede0
|
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
spec/mocks/* linguist-vendored
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ master ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ master ]
|
20
|
+
schedule:
|
21
|
+
- cron: '34 8 * * 0'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'ruby' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v2
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v1
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
52
|
+
|
53
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
54
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
55
|
+
- name: Autobuild
|
56
|
+
uses: github/codeql-action/autobuild@v1
|
57
|
+
|
58
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
59
|
+
# 📚 https://git.io/JvXDl
|
60
|
+
|
61
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
62
|
+
# and modify them (or add more) to build your code if your project
|
63
|
+
# uses a compiled language
|
64
|
+
|
65
|
+
#- run: |
|
66
|
+
# make bootstrap
|
67
|
+
# make release
|
68
|
+
|
69
|
+
- name: Perform CodeQL Analysis
|
70
|
+
uses: github/codeql-action/analyze@v1
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: ['2.5', '2.7']
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
30
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
31
|
+
- name: Run tests
|
32
|
+
run: script -e -c "bundle exec rspec"
|
data/.rubocop.yml
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
3
|
AllCops:
|
4
|
+
TargetRubyVersion: 2.5
|
4
5
|
Exclude:
|
5
6
|
- 'templates/**/*'
|
6
7
|
- 'spec/fixtures/**/*'
|
7
8
|
- 'regression/**/*'
|
8
|
-
|
9
|
+
NewCops: enable
|
9
10
|
|
10
11
|
Lint/AmbiguousBlockAssociation:
|
11
12
|
Exclude:
|
12
13
|
- 'spec/**/*.rb'
|
13
14
|
|
15
|
+
Lint/ConstantDefinitionInBlock:
|
16
|
+
Exclude:
|
17
|
+
- 'spec/**/*.rb'
|
18
|
+
|
19
|
+
Lint/DuplicateBranch:
|
20
|
+
Enabled: false
|
21
|
+
|
14
22
|
Metrics/BlockLength:
|
15
23
|
Exclude:
|
16
24
|
- 'Rakefile'
|
@@ -26,5 +34,5 @@ Metrics/ModuleLength:
|
|
26
34
|
Exclude:
|
27
35
|
- 'spec/**/*.rb'
|
28
36
|
|
29
|
-
Naming/
|
37
|
+
Naming/MethodParameterName:
|
30
38
|
MinNameLength: 1
|
data/.travis.yml
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
- 2.
|
4
|
+
- 2.5.8
|
5
5
|
env:
|
6
6
|
global:
|
7
7
|
- CC_TEST_REPORTER_ID=cb942bcc168feb78c43c506364d5344c5ec9a46a0b68dc66acb581e77c981ff1
|
8
8
|
- COVERAGE=true
|
9
|
-
before_install:
|
10
|
-
- gem install bundler -v '2.1.4'
|
11
9
|
before_script:
|
12
10
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
13
11
|
- chmod +x ./cc-test-reporter
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,33 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.6.9 (2021-12-25)
|
6
|
+
### Added
|
7
|
+
- input_format.rb : \hspace{...}, \text{...} support
|
8
|
+
- input_format.rb : \rm, \textrm{...} support
|
9
|
+
- modulo.rb : \text{mod}, {\bmod}, (10^9+7) support
|
10
|
+
|
11
|
+
## 0.6.8 (2021-05-27)
|
12
|
+
### Deleted
|
13
|
+
- drop Ruby2.4 from target version.
|
14
|
+
|
15
|
+
## 0.6.7 (2020-12-20)
|
16
|
+
### Changed
|
17
|
+
- replace hspace with ' ' [#85](https://github.com/nejiko96/at_coder_friends/pull/85) ([suzukiapple](https://github.com/suzukiapple))
|
18
|
+
### Deleted
|
19
|
+
- drop Ruby2.3 from target version.
|
20
|
+
|
21
|
+
## 0.6.6 (2020-05-29)
|
22
|
+
### Added
|
23
|
+
- open submission list after submit.
|
24
|
+
- enable -%> in ERBs.
|
25
|
+
- error handling in fetch_problem.
|
26
|
+
- remove \mathrm{...} from expressions.
|
27
|
+
|
28
|
+
### Changed
|
29
|
+
- change task id match pattern on submission.
|
30
|
+
- treat input more than 19 digits as string.
|
31
|
+
|
5
32
|
## 0.6.5 (2020-04-15)
|
6
33
|
### Added
|
7
34
|
- multiple language version support.
|
data/Gemfile.lock
CHANGED
@@ -1,77 +1,85 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
at_coder_friends (0.6.
|
4
|
+
at_coder_friends (0.6.9)
|
5
5
|
colorize (~> 0.8.1)
|
6
|
-
launchy (
|
6
|
+
launchy (>= 2.4.3)
|
7
7
|
mechanize (~> 2.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
addressable (2.
|
12
|
+
addressable (2.8.0)
|
13
13
|
public_suffix (>= 2.0.2, < 5.0)
|
14
14
|
colorize (0.8.1)
|
15
|
-
connection_pool (2.2.
|
16
|
-
crack (0.4.
|
17
|
-
|
18
|
-
diff-lcs (1.
|
19
|
-
docile (1.
|
15
|
+
connection_pool (2.2.5)
|
16
|
+
crack (0.4.5)
|
17
|
+
rexml
|
18
|
+
diff-lcs (1.5.0)
|
19
|
+
docile (1.4.0)
|
20
20
|
domain_name (0.5.20190701)
|
21
21
|
unf (>= 0.0.5, < 1.0.0)
|
22
22
|
hashdiff (1.0.1)
|
23
|
-
http-cookie (1.0.
|
23
|
+
http-cookie (1.0.4)
|
24
24
|
domain_name (~> 0.5)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
domain_name (~> 0.5, >= 0.5.
|
30
|
-
http-cookie (~> 1.0)
|
31
|
-
mime-types (
|
32
|
-
net-http-digest_auth (~> 1.
|
33
|
-
net-http-persistent (>= 2.5.2)
|
34
|
-
nokogiri (~> 1.
|
35
|
-
|
36
|
-
|
37
|
-
|
25
|
+
launchy (2.5.0)
|
26
|
+
addressable (~> 2.7)
|
27
|
+
mechanize (2.8.3)
|
28
|
+
addressable (~> 2.8)
|
29
|
+
domain_name (~> 0.5, >= 0.5.20190701)
|
30
|
+
http-cookie (~> 1.0, >= 1.0.3)
|
31
|
+
mime-types (~> 3.0)
|
32
|
+
net-http-digest_auth (~> 1.4, >= 1.4.1)
|
33
|
+
net-http-persistent (>= 2.5.2, < 5.0.dev)
|
34
|
+
nokogiri (~> 1.11, >= 1.11.2)
|
35
|
+
rubyntlm (~> 0.6, >= 0.6.3)
|
36
|
+
webrick (~> 1.7)
|
37
|
+
webrobots (~> 0.1.2)
|
38
|
+
mime-types (3.4.1)
|
38
39
|
mime-types-data (~> 3.2015)
|
39
|
-
mime-types-data (3.
|
40
|
-
mini_portile2 (2.
|
40
|
+
mime-types-data (3.2021.1115)
|
41
|
+
mini_portile2 (2.6.1)
|
41
42
|
net-http-digest_auth (1.4.1)
|
42
|
-
net-http-persistent (
|
43
|
+
net-http-persistent (4.0.1)
|
43
44
|
connection_pool (~> 2.2)
|
44
|
-
nokogiri (1.
|
45
|
-
mini_portile2 (~> 2.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
rspec
|
54
|
-
rspec-
|
55
|
-
|
45
|
+
nokogiri (1.12.5)
|
46
|
+
mini_portile2 (~> 2.6.1)
|
47
|
+
racc (~> 1.4)
|
48
|
+
nokogiri (1.12.5-x64-mingw32)
|
49
|
+
racc (~> 1.4)
|
50
|
+
public_suffix (4.0.6)
|
51
|
+
racc (1.6.0)
|
52
|
+
rake (13.0.6)
|
53
|
+
rexml (3.2.5)
|
54
|
+
rspec (3.10.0)
|
55
|
+
rspec-core (~> 3.10.0)
|
56
|
+
rspec-expectations (~> 3.10.0)
|
57
|
+
rspec-mocks (~> 3.10.0)
|
58
|
+
rspec-core (3.10.1)
|
59
|
+
rspec-support (~> 3.10.0)
|
60
|
+
rspec-expectations (3.10.1)
|
56
61
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-mocks (3.
|
62
|
+
rspec-support (~> 3.10.0)
|
63
|
+
rspec-mocks (3.10.2)
|
59
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-support (3.
|
62
|
-
|
63
|
-
simplecov (0.
|
65
|
+
rspec-support (~> 3.10.0)
|
66
|
+
rspec-support (3.10.3)
|
67
|
+
rubyntlm (0.6.3)
|
68
|
+
simplecov (0.21.2)
|
64
69
|
docile (~> 1.1)
|
65
|
-
|
66
|
-
|
67
|
-
simplecov-html (0.
|
70
|
+
simplecov-html (~> 0.11)
|
71
|
+
simplecov_json_formatter (~> 0.1)
|
72
|
+
simplecov-html (0.12.3)
|
73
|
+
simplecov_json_formatter (0.1.3)
|
68
74
|
unf (0.1.4)
|
69
75
|
unf_ext
|
70
|
-
unf_ext (0.0.
|
71
|
-
|
72
|
-
|
76
|
+
unf_ext (0.0.8)
|
77
|
+
unf_ext (0.0.8-x64-mingw32)
|
78
|
+
webmock (3.14.0)
|
79
|
+
addressable (>= 2.8.0)
|
73
80
|
crack (>= 0.3.2)
|
74
81
|
hashdiff (>= 0.4.0, < 2.0.0)
|
82
|
+
webrick (1.7.0)
|
75
83
|
webrobots (0.1.2)
|
76
84
|
|
77
85
|
PLATFORMS
|
@@ -87,4 +95,4 @@ DEPENDENCIES
|
|
87
95
|
webmock (~> 3.0)
|
88
96
|
|
89
97
|
BUNDLED WITH
|
90
|
-
2.
|
98
|
+
2.2.32
|
data/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/at_coder_friends.svg)](https://badge.fury.io/rb/at_coder_friends)
|
2
|
-
|
2
|
+
![Gem](https://img.shields.io/gem/dt/at_coder_friends)
|
3
|
+
[![Ruby](https://github.com/nejiko96/at_coder_friends/actions/workflows/ruby.yml/badge.svg)](https://github.com/nejiko96/at_coder_friends/actions/workflows/ruby.yml)
|
4
|
+
[![CodeQL](https://github.com/nejiko96/at_coder_friends/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/nejiko96/at_coder_friends/actions/workflows/codeql-analysis.yml)
|
3
5
|
[![Maintainability](https://api.codeclimate.com/v1/badges/dcd1ce08d11703be2f00/maintainability)](https://codeclimate.com/github/nejiko96/at_coder_friends/maintainability)
|
4
6
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/dcd1ce08d11703be2f00/test_coverage)](https://codeclimate.com/github/nejiko96/at_coder_friends/test_coverage)
|
7
|
+
![GitHub](https://img.shields.io/github/license/nejiko96/at_coder_friends)
|
8
|
+
<!-- [![Build Status](https://travis-ci.org/nejiko96/at_coder_friends.svg?branch=master)](https://travis-ci.org/nejiko96/at_coder_friends) -->
|
5
9
|
|
6
10
|
# AtCoderFriends
|
7
11
|
|
@@ -16,7 +20,7 @@ AtCoderFriends automates tasks about [AtCoder](https://atcoder.jp/) programming
|
|
16
20
|
|
17
21
|
## Dependencies
|
18
22
|
|
19
|
-
- Ruby 2.
|
23
|
+
- Ruby 2.5 or newer
|
20
24
|
- [Mechanize](https://github.com/sparklemotion/mechanize)
|
21
25
|
|
22
26
|
## Installation
|
data/at_coder_friends.gemspec
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'at_coder_friends/version'
|
3
|
+
require_relative 'lib/at_coder_friends/version'
|
6
4
|
|
7
5
|
Gem::Specification.new do |spec|
|
8
6
|
spec.name = 'at_coder_friends'
|
@@ -30,16 +28,17 @@ Gem::Specification.new do |spec|
|
|
30
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
29
|
spec.require_paths = ['lib']
|
32
30
|
|
33
|
-
spec.required_ruby_version = '>= 2.
|
31
|
+
spec.required_ruby_version = '>= 2.5.0'
|
34
32
|
|
35
33
|
spec.metadata = {
|
36
34
|
'homepage_uri' => spec.homepage,
|
37
35
|
'source_code_uri' => spec.homepage,
|
38
|
-
'changelog_uri' =>
|
36
|
+
'changelog_uri' => "#{spec.homepage}/blob/master/CHANGELOG.md",
|
37
|
+
'rubygems_mfa_required' => 'true'
|
39
38
|
}
|
40
39
|
|
41
40
|
spec.add_dependency 'colorize', '~> 0.8.1'
|
42
|
-
spec.add_dependency 'launchy', '
|
41
|
+
spec.add_dependency 'launchy', '>= 2.4.3'
|
43
42
|
spec.add_dependency 'mechanize', '~> 2.0'
|
44
43
|
|
45
44
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
data/docs/CONFIGURATION.md
CHANGED
@@ -279,66 +279,10 @@ ext_settings:
|
|
279
279
|
|---------|-------------|---------|
|
280
280
|
|default_template|Source template file path|[/templates/cxx_builtin.cxx.erb](/templates/cxx_builtin.cxx.erb)|
|
281
281
|
|
282
|
-
### Language ID list (2020/
|
282
|
+
### Language ID list (2020/06/21)
|
283
283
|
|
284
284
|
| Language ID | Description |
|
285
285
|
|-------------|-------------|
|
286
|
-
|3003|C++14 (GCC 5.4.1)|
|
287
|
-
|3001|Bash (GNU bash v4.3.11)|
|
288
|
-
|3002|C (GCC 5.4.1)|
|
289
|
-
|3004|C (Clang 3.8.0)|
|
290
|
-
|3005|C++14 (Clang 3.8.0)|
|
291
|
-
|3006|C# (Mono 4.6.2.0)|
|
292
|
-
|3007|Clojure (1.8.0)|
|
293
|
-
|3008|Common Lisp (SBCL 1.1.14)|
|
294
|
-
|3009|D (DMD64 v2.070.1)|
|
295
|
-
|3010|D (LDC 0.17.0)|
|
296
|
-
|3011|D (GDC 4.9.4)|
|
297
|
-
|3012|Fortran (gfortran v4.8.4)|
|
298
|
-
|3013|Go (1.6)|
|
299
|
-
|3014|Haskell (GHC 7.10.3)|
|
300
|
-
|3015|Java7 (OpenJDK 1.7.0)|
|
301
|
-
|3016|Java8 (OpenJDK 1.8.0)|
|
302
|
-
|3017|JavaScript (node.js v5.12)|
|
303
|
-
|3018|OCaml (4.02.3)|
|
304
|
-
|3019|Pascal (FPC 2.6.2)|
|
305
|
-
|3020|Perl (v5.18.2)|
|
306
|
-
|3021|PHP (5.6.30)|
|
307
|
-
|3022|Python2 (2.7.6)|
|
308
|
-
|3023|Python3 (3.4.3)|
|
309
|
-
|3024|Ruby (2.3.3)|
|
310
|
-
|3025|Scala (2.11.7)|
|
311
|
-
|3026|Scheme (Gauche 0.9.3.3)|
|
312
|
-
|3027|Text (cat)|
|
313
|
-
|3028|Visual Basic (Mono 4.0.1)|
|
314
|
-
|3029|C++ (GCC 5.4.1)|
|
315
|
-
|3030|C++ (Clang 3.8.0)|
|
316
|
-
|3501|Objective-C (GCC 5.3.0)|
|
317
|
-
|3502|Objective-C (Clang3.8.0)|
|
318
|
-
|3503|Swift (swift-2.2-RELEASE)|
|
319
|
-
|3504|Rust (1.15.1)|
|
320
|
-
|3505|Sed (GNU sed 4.2.2)|
|
321
|
-
|3506|Awk (mawk 1.3.3)|
|
322
|
-
|3507|Brainfuck (bf 20041219)|
|
323
|
-
|3508|Standard ML (MLton 20100608)|
|
324
|
-
|3509|PyPy2 (5.6.0)|
|
325
|
-
|3510|PyPy3 (2.4.0)|
|
326
|
-
|3511|Crystal (0.20.5)|
|
327
|
-
|3512|F# (Mono 4.0)|
|
328
|
-
|3513|Unlambda (0.1.3)|
|
329
|
-
|3514|Lua (5.3.2)|
|
330
|
-
|3515|LuaJIT (2.0.4)|
|
331
|
-
|3516|MoonScript (0.5.0)|
|
332
|
-
|3517|Ceylon (1.2.1)|
|
333
|
-
|3518|Julia (0.5.0)|
|
334
|
-
|3519|Octave (4.0.2)|
|
335
|
-
|3520|Nim (0.13.0)|
|
336
|
-
|3521|TypeScript (2.1.6)|
|
337
|
-
|3522|Perl6 (rakudo-star 2016.01)|
|
338
|
-
|3523|Kotlin (1.0.0)|
|
339
|
-
|3524|PHP7 (7.0.15)|
|
340
|
-
|3525|COBOL - Fixed (OpenCOBOL 1.1.0)|
|
341
|
-
|3526|COBOL - Free (OpenCOBOL 1.1.0)|
|
342
286
|
|4001|C (GCC 9.2.1)|
|
343
287
|
|4002|C (Clang 10.0.0)|
|
344
288
|
|4003|C++ (GCC 9.2.1)|
|
@@ -460,18 +404,18 @@ test_cmd 文字列中の以下の変数には、
|
|
460
404
|
test_cmd: ~
|
461
405
|
```
|
462
406
|
|
463
|
-
- Add .
|
464
|
-
.
|
407
|
+
- Add .raku(Raku) settings
|
408
|
+
.raku(Raku)の設定を追加
|
465
409
|
```YAML
|
466
410
|
ext_settings:
|
467
|
-
'
|
468
|
-
submit_lang: '
|
411
|
+
'raku':
|
412
|
+
submit_lang: '4043' # Raku
|
469
413
|
```
|
470
414
|
|
471
|
-
- Change submission language of .cxx to C++
|
472
|
-
.cxxの提出言語をC++
|
415
|
+
- Change submission language of .cxx to C++(Clang)
|
416
|
+
.cxxの提出言語をC++(Clang)に変更
|
473
417
|
```YAML
|
474
418
|
ext_settings:
|
475
419
|
'cxx':
|
476
|
-
submit_lang: '
|
420
|
+
submit_lang: '4004' # C++(Clang)
|
477
421
|
```
|
data/lib/at_coder_friends/cli.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'optparse'
|
4
|
+
require 'launchy'
|
4
5
|
|
5
6
|
module AtCoderFriends
|
6
7
|
# command line interface
|
@@ -116,6 +117,7 @@ module AtCoderFriends
|
|
116
117
|
|
117
118
|
ctx.scraping_agent.submit
|
118
119
|
vf.unverify
|
120
|
+
open_submission_list
|
119
121
|
end
|
120
122
|
|
121
123
|
def check_and_go
|
@@ -124,6 +126,7 @@ module AtCoderFriends
|
|
124
126
|
# submit automatically
|
125
127
|
ctx.scraping_agent.submit
|
126
128
|
vf.unverify
|
129
|
+
open_submission_list
|
127
130
|
else
|
128
131
|
# enable manual submit
|
129
132
|
vf.verify
|
@@ -139,8 +142,13 @@ module AtCoderFriends
|
|
139
142
|
end
|
140
143
|
|
141
144
|
def open_contest
|
142
|
-
require 'launchy'
|
143
145
|
Launchy.open(ctx.scraping_agent.contest_url)
|
144
146
|
end
|
147
|
+
|
148
|
+
def open_submission_list
|
149
|
+
url = ctx.scraping_agent.contest_url('submissions/me')
|
150
|
+
puts "submission status : #{url}"
|
151
|
+
Launchy.open(url)
|
152
|
+
end
|
145
153
|
end
|
146
154
|
end
|
@@ -51,18 +51,17 @@ module AtCoderFriends
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def merge(base_hash, derived_hash)
|
54
|
-
|
54
|
+
base_hash.merge(derived_hash) do |_, base_val, derived_val|
|
55
55
|
if base_val.is_a?(Hash) && derived_val.is_a?(Hash)
|
56
56
|
merge(base_val, derived_val)
|
57
57
|
else
|
58
58
|
derived_val
|
59
59
|
end
|
60
60
|
end
|
61
|
-
res
|
62
61
|
end
|
63
62
|
|
64
63
|
def load_yaml(path)
|
65
|
-
yaml =
|
64
|
+
yaml = File.read(path, encoding: Encoding::UTF_8)
|
66
65
|
YAML.safe_load(yaml, [], [], false, path) || {}
|
67
66
|
rescue Errno::ENOENT
|
68
67
|
raise ConfigNotFoundError,
|
@@ -21,7 +21,7 @@ module AtCoderFriends
|
|
21
21
|
def generate(pbm)
|
22
22
|
@pbm = pbm
|
23
23
|
src = File.read(select_template)
|
24
|
-
src = ERB.new(src).result(binding)
|
24
|
+
src = ERB.new(src, safe_level = nil, trim_mode = '-').result(binding)
|
25
25
|
src = render(src) if respond_to?(:render)
|
26
26
|
src
|
27
27
|
end
|
@@ -238,8 +238,7 @@ module AtCoderFriends
|
|
238
238
|
def render(src)
|
239
239
|
src = embed_lines(src, '/*** CONSTS ***/', gen_consts)
|
240
240
|
src = embed_lines(src, '/*** DCLS ***/', gen_decls)
|
241
|
-
|
242
|
-
src
|
241
|
+
embed_lines(src, '/*** INPUTS ***/', gen_inputs)
|
243
242
|
end
|
244
243
|
|
245
244
|
def gen_consts(constants = pbm.constants)
|
@@ -12,15 +12,14 @@ module AtCoderFriends
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def process(pbm)
|
15
|
-
generators = ctx.config
|
15
|
+
generators = ctx.config['generators'] || []
|
16
16
|
generators.each do |gen_name|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
17
|
+
gen_obj = load_obj(gen_name)
|
18
|
+
gen_obj.process(pbm)
|
19
|
+
rescue StandardError => e
|
20
|
+
puts "an error occurred in generator:#{gen_name}."
|
21
|
+
puts e.to_s
|
22
|
+
puts e.backtrace
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
@@ -15,8 +15,7 @@ module AtCoderFriends
|
|
15
15
|
|
16
16
|
def render(src)
|
17
17
|
src = embed_lines(src, '### CONSTS ###', gen_consts)
|
18
|
-
|
19
|
-
src
|
18
|
+
embed_lines(src, '### DCLS ###', gen_decls)
|
20
19
|
end
|
21
20
|
|
22
21
|
def gen_consts(constants = pbm.constants)
|
@@ -110,7 +109,7 @@ module AtCoderFriends
|
|
110
109
|
vs[mx] += 's'
|
111
110
|
sz = inpdef.size[0]
|
112
111
|
dcls = vs.map { |v| "#{v}[i]" }
|
113
|
-
dcls[mx] =
|
112
|
+
dcls[mx] = "*#{dcls[mx]}" unless inpdef.item == :char
|
114
113
|
dcl = dcls.join(', ')
|
115
114
|
expr = gen_cmb_expr(inpdef)
|
116
115
|
ret = []
|
@@ -16,9 +16,10 @@ module AtCoderFriends
|
|
16
16
|
re1, re2 = vs.map { |v| Regexp.escape(v) }
|
17
17
|
|
18
18
|
pbm.options.binary_values =
|
19
|
-
|
19
|
+
case out_fmt
|
20
|
+
when /#{re1}.+#{re2}/m
|
20
21
|
vs
|
21
|
-
|
22
|
+
when /#{re2}.+#{re1}/m
|
22
23
|
vs.reverse
|
23
24
|
end
|
24
25
|
end
|
@@ -60,10 +60,16 @@ module AtCoderFriends
|
|
60
60
|
.gsub('\\)', '')
|
61
61
|
.gsub('\\lvert', '|')
|
62
62
|
.gsub('\\rvert', '|')
|
63
|
-
.gsub('\\mathit', '')
|
64
63
|
.gsub('\\times', '*')
|
65
64
|
.gsub(/\\begin(\{[^{}]*\})*/, '')
|
66
65
|
.gsub(/\\end(\{[^{}]*\})*/, '')
|
66
|
+
.gsub(/\\hspace(\{[^{}]*\})*/, ' ')
|
67
|
+
.gsub(/\\mathrm\{([^{}]*)\}/, '\1')
|
68
|
+
.gsub(/\\mathit\{([^{}]*)\}/, '\1')
|
69
|
+
.gsub(/\\textrm\{([^{}]*)\}/, '\1')
|
70
|
+
.gsub(/\\text\{([^{}]*)\}/, '\1')
|
71
|
+
.gsub(/\\rm\{([^{}]*)\}/, '\1')
|
72
|
+
.gsub('\\rm ', ' ')
|
67
73
|
.gsub(/\\[cdlv]?dots/, '..')
|
68
74
|
.gsub(/\{\}/, ' ')
|
69
75
|
.gsub('−', '-') # full width hyphen
|
@@ -146,8 +152,8 @@ module AtCoderFriends
|
|
146
152
|
class InputFormatMatcher
|
147
153
|
include InputFormatUtils
|
148
154
|
|
149
|
-
attr_reader :container, :item, :pat, :gen_names, :gen_pat2
|
150
|
-
|
155
|
+
attr_reader :container, :item, :pat, :gen_names, :gen_pat2,
|
156
|
+
:names, :pat2, :size, :delim, :ix0
|
151
157
|
|
152
158
|
def initialize(
|
153
159
|
container: nil, item: nil,
|
@@ -166,8 +172,8 @@ module AtCoderFriends
|
|
166
172
|
|
167
173
|
@names = gen_names.call(m1)
|
168
174
|
@pat2 = gen_pat2&.call(names)
|
169
|
-
@size = m1.names.include?('sz') && m1['sz'] || ''
|
170
|
-
@ix0 = m1.names.include?('ix0') && m1['ix0'] || size
|
175
|
+
@size = (m1.names.include?('sz') && m1['sz']) || ''
|
176
|
+
@ix0 = (m1.names.include?('ix0') && m1['ix0']) || size
|
171
177
|
@delim = dlm
|
172
178
|
true
|
173
179
|
end
|
@@ -414,7 +420,7 @@ module AtCoderFriends
|
|
414
420
|
SINGLE_MATCHER = InputFormatMatcher.new(
|
415
421
|
container: :single,
|
416
422
|
pat: /\A(.*\s)?#{RE_SINGLE}(\s.*)?\z/,
|
417
|
-
gen_names: ->(m) { m[0].split.
|
423
|
+
gen_names: ->(m) { m[0].split.grep(/\A#{RE_SINGLE}\z/) }
|
418
424
|
)
|
419
425
|
MATCHERS = [
|
420
426
|
MATRIX_MATCHER,
|
@@ -467,8 +473,8 @@ module AtCoderFriends
|
|
467
473
|
|
468
474
|
ret << matcher.to_inpdef
|
469
475
|
end
|
470
|
-
|
471
|
-
|
476
|
+
matcher = MATCHERS.find { |m| m.match(line) }
|
477
|
+
if !line.empty? && matcher.nil?
|
472
478
|
puts "unknown format: #{line}"
|
473
479
|
ret << unknown_fmt(line)
|
474
480
|
end
|
@@ -6,10 +6,11 @@ module AtCoderFriends
|
|
6
6
|
module InputType
|
7
7
|
module_function
|
8
8
|
|
9
|
-
NUMBER_PAT = /\A[+-]?[0-9]
|
9
|
+
NUMBER_PAT = /\A[+-]?[0-9]{1,19}\z/.freeze
|
10
|
+
DECIMAL_PAT = /\A[+-]?[0-9]{1,19}(\.[0-9]+)?\z/.freeze
|
10
11
|
TYPE_TBL = [
|
11
12
|
[:number, NUMBER_PAT],
|
12
|
-
[:decimal,
|
13
|
+
[:decimal, DECIMAL_PAT]
|
13
14
|
].freeze
|
14
15
|
|
15
16
|
def process(pbm)
|
@@ -6,7 +6,6 @@ module AtCoderFriends
|
|
6
6
|
module Modulo
|
7
7
|
module_function
|
8
8
|
|
9
|
-
# rubocop:disable Style/AsciiComments
|
10
9
|
SECTIONS = [
|
11
10
|
Problem::SECTION_OUT_FMT,
|
12
11
|
Problem::SECTION_STATEMENT,
|
@@ -18,6 +17,7 @@ module AtCoderFriends
|
|
18
17
|
VALUE_PATTERN = %r{
|
19
18
|
(?:
|
20
19
|
<var>([^<>]+)</var>
|
20
|
+
|\(([^()]+)\)
|
21
21
|
|\\\(([^()]+)\\\)
|
22
22
|
|\$([^$]+)\$
|
23
23
|
|\{([^{}]+)\}
|
@@ -29,10 +29,9 @@ module AtCoderFriends
|
|
29
29
|
MOD_PATTERN = /
|
30
30
|
(?:
|
31
31
|
#{VALUE_PATTERN}\s*(?:\([^()]+\)\s*)?で割った(?:剰余|余り|あまり)
|
32
|
-
|(?:modulo|mod|
|
32
|
+
|(?:modulo|mod|divid(?:ed|ing)\s*by)\s*#{VALUE_PATTERN}
|
33
33
|
)
|
34
34
|
/xi.freeze
|
35
|
-
# rubocop:enable Style/AsciiComments
|
36
35
|
|
37
36
|
def process(pbm)
|
38
37
|
mods = []
|
@@ -59,10 +58,9 @@ module AtCoderFriends
|
|
59
58
|
s
|
60
59
|
.tr('0-9A-Za-z', '0-9A-Za-z')
|
61
60
|
.gsub(/[[:space:]]/, ' ')
|
62
|
-
.gsub(%r{[^一-龠_
|
63
|
-
.gsub(/{\\
|
64
|
-
.gsub(/\\
|
65
|
-
.gsub(/\\mbox\s*{\s*mod\s*}/i, 'mod') # \mbox{mod} -> mod
|
61
|
+
.gsub(%r{[^一-龠_ぁ-んァ-ヶーa-zA-Z0-9 -/:-@\[-`\{-~]}, '')
|
62
|
+
.gsub(/{\\[a-z]+\s*mod\s*}\\?/i, 'mod') # {\rm mod}, {\bmod} -> mod
|
63
|
+
.gsub(/\\[a-z]+\s*{\s*mod\s*}\\?/i, 'mod') # \text{mod} -> mod
|
66
64
|
.gsub(%r{<var>\s*mod\s*</var>}i, 'mod') # <var>mod</var> -> mod
|
67
65
|
end
|
68
66
|
|
@@ -23,15 +23,13 @@ module AtCoderFriends
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def content
|
26
|
-
@content ||=
|
26
|
+
@content ||=
|
27
27
|
siblings.reduce('') { |m, node| m + node.content }.gsub("\r\n", "\n")
|
28
|
-
end
|
29
28
|
end
|
30
29
|
|
31
30
|
def html
|
32
|
-
@html ||=
|
31
|
+
@html ||=
|
33
32
|
siblings.reduce('') { |m, node| m + node.to_html }.gsub("\r\n", "\n")
|
34
|
-
end
|
35
33
|
end
|
36
34
|
|
37
35
|
def find_element(tags)
|
@@ -54,7 +52,7 @@ module AtCoderFriends
|
|
54
52
|
|
55
53
|
def code_block(mtd)
|
56
54
|
elem = find_element(%w[pre blockquote])
|
57
|
-
elem && elem.send(mtd).lstrip.gsub("\r\n", "\n") || ''
|
55
|
+
(elem && elem.send(mtd).lstrip.gsub("\r\n", "\n")) || ''
|
58
56
|
end
|
59
57
|
end
|
60
58
|
end
|
@@ -63,7 +63,7 @@ module AtCoderFriends
|
|
63
63
|
{
|
64
64
|
key: Problem::SECTION_IN_SMP,
|
65
65
|
pattern: /
|
66
|
-
\A(
|
66
|
+
\A(?:
|
67
67
|
入力例\s*(?<no>\d+)?
|
68
68
|
|入力\s*(?<no>\d+)
|
69
69
|
|Sample\s*Input\s*(?<no>\d+)?
|
@@ -75,14 +75,14 @@ module AtCoderFriends
|
|
75
75
|
{
|
76
76
|
key: Problem::SECTION_OUT_SMP,
|
77
77
|
pattern: /
|
78
|
-
\A(
|
78
|
+
\A(?:
|
79
79
|
出力例\s*(?<no>\d+)?
|
80
80
|
|出力\s*(?<no>\d+)
|
81
81
|
|入力例\s*(?<no>\d+)?\s*に対する出力例
|
82
82
|
|Sample\s*Output\s*(?<no>\d+)?
|
83
83
|
|Output\s*Example\s*(?<no>\d+)?
|
84
84
|
|Output\s*(?<no>\d+)
|
85
|
-
|Output\s*for\s*(the)?\s*Sample\s*Input\s*(?<no>\d+)?
|
85
|
+
|Output\s*for\s*(?:the)?\s*Sample\s*Input\s*(?<no>\d+)?
|
86
86
|
)\z
|
87
87
|
/xi
|
88
88
|
},
|
@@ -129,7 +129,7 @@ module AtCoderFriends
|
|
129
129
|
key = nil
|
130
130
|
SECTION_DEFS.any? do |grp|
|
131
131
|
if (m = title.match(grp[:pattern]))
|
132
|
-
no = m.names.include?('no') && m['no'] || '1'
|
132
|
+
no = (m.names.include?('no') && m['no']) || '1'
|
133
133
|
key = format(grp[:key], no: no)
|
134
134
|
end
|
135
135
|
end
|
@@ -140,7 +140,7 @@ module AtCoderFriends
|
|
140
140
|
s
|
141
141
|
.tr('0-9A-Za-z', '0-9A-Za-z')
|
142
142
|
.gsub(/[[:space:]]/, ' ') # &npsp; full-width space
|
143
|
-
.gsub(/[^一-龠_
|
143
|
+
.gsub(/[^一-龠_ぁ-んァ-ヶーa-zA-Z0-9 ]/, '')
|
144
144
|
.strip
|
145
145
|
end
|
146
146
|
end
|
@@ -23,7 +23,7 @@ module AtCoderFriends
|
|
23
23
|
@agent = Mechanize.new
|
24
24
|
agent.user_agent = "AtCoderFriends/#{VERSION} (#{CONTACT})"
|
25
25
|
agent.pre_connect_hooks << proc { sleep 0.1 }
|
26
|
-
agent.log = Logger.new(
|
26
|
+
agent.log = Logger.new($stderr) if ctx.options[:debug]
|
27
27
|
load_session
|
28
28
|
end
|
29
29
|
|
@@ -25,7 +25,7 @@ module AtCoderFriends
|
|
25
25
|
raise e if username_link(e.page)
|
26
26
|
end
|
27
27
|
|
28
|
-
agent.get(common_url('login')
|
28
|
+
agent.get("#{common_url('login')}?continue=#{CGI.escape(url)}")
|
29
29
|
end
|
30
30
|
|
31
31
|
def post_login(page)
|
@@ -40,13 +40,13 @@ module AtCoderFriends
|
|
40
40
|
user = ctx.config['user'].to_s
|
41
41
|
if user.empty?
|
42
42
|
print('enter username:')
|
43
|
-
user =
|
43
|
+
user = $stdin.gets.chomp
|
44
44
|
end
|
45
45
|
|
46
46
|
pass = ctx.config['password'].to_s
|
47
47
|
if pass.empty?
|
48
48
|
print("enter password for #{user}:")
|
49
|
-
pass =
|
49
|
+
pass = $stdin.noecho(&:gets).chomp
|
50
50
|
puts
|
51
51
|
end
|
52
52
|
[user, pass]
|
@@ -18,7 +18,7 @@ module AtCoderFriends
|
|
18
18
|
lang = find_lang(page, langs)
|
19
19
|
form = page.forms[1]
|
20
20
|
form.field_with(name: 'data.TaskScreenName') do |sel|
|
21
|
-
option = sel.options.find { |op| op.text
|
21
|
+
option = sel.options.find { |op| op.text =~ /\A#{q}\W/ }
|
22
22
|
option&.select || (raise AppError, "unknown problem:#{q}.")
|
23
23
|
end
|
24
24
|
form.add_field!('data.LanguageId', lang)
|
@@ -121,7 +121,7 @@ module AtCoderFriends
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def which_os
|
124
|
-
@which_os ||=
|
124
|
+
@which_os ||=
|
125
125
|
case RbConfig::CONFIG['host_os']
|
126
126
|
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
127
127
|
:windows
|
@@ -134,7 +134,6 @@ module AtCoderFriends
|
|
134
134
|
else
|
135
135
|
:unknown
|
136
136
|
end
|
137
|
-
end
|
138
137
|
end
|
139
138
|
end
|
140
139
|
end
|
@@ -16,17 +16,17 @@ module AtCoderFriends
|
|
16
16
|
puts "***** judge_all #{prg} (#{test_loc}) *****"
|
17
17
|
results = Dir["#{data_dir}/#{q}/in/*"].sort.map do |infile|
|
18
18
|
id = File.basename(infile)
|
19
|
-
judge(id, false)
|
19
|
+
judge(id, detail: false)
|
20
20
|
end
|
21
21
|
!results.empty? && results.all?
|
22
22
|
end
|
23
23
|
|
24
24
|
def judge_one(id)
|
25
25
|
puts "***** judge_one #{prg} (#{test_loc}) *****"
|
26
|
-
judge(id, true)
|
26
|
+
judge(id, detail: true)
|
27
27
|
end
|
28
28
|
|
29
|
-
def judge(id, detail
|
29
|
+
def judge(id, detail: true)
|
30
30
|
@detail = detail
|
31
31
|
infile = "#{data_dir}/#{q}/in/#{id}"
|
32
32
|
outfile = "#{result_dir}/#{q}/result/#{id}"
|
@@ -1,17 +1,20 @@
|
|
1
1
|
// <%= pbm.url %>
|
2
|
-
|
3
|
-
if pbm.options.interactive
|
4
|
-
%>
|
2
|
+
|
5
3
|
#include <cstdio>
|
4
|
+
<% if pbm.options.interactive -%>
|
6
5
|
#include <vector>
|
7
6
|
#include <string>
|
7
|
+
<% end -%>
|
8
8
|
|
9
9
|
using namespace std;
|
10
10
|
|
11
|
+
<% if pbm.options.interactive -%>
|
11
12
|
#define DEBUG
|
13
|
+
<% end -%>
|
12
14
|
#define REP(i,n) for(int i=0; i<(int)(n); i++)
|
13
15
|
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
|
14
16
|
|
17
|
+
<% if pbm.options.interactive -%>
|
15
18
|
//------------------------------------------------------------------------------
|
16
19
|
const int BUFSIZE = 1024;
|
17
20
|
char req[BUFSIZE];
|
@@ -33,11 +36,17 @@ void query() {
|
|
33
36
|
}
|
34
37
|
|
35
38
|
//------------------------------------------------------------------------------
|
36
|
-
<%
|
37
|
-
<%
|
38
|
-
|
39
|
-
<% end
|
39
|
+
<% end -%>
|
40
|
+
<% gen_consts.each do |line| -%>
|
41
|
+
<%= line %>
|
42
|
+
<% end -%>
|
43
|
+
|
44
|
+
<% gen_decls.each do |line| -%>
|
45
|
+
<%= line %>
|
46
|
+
<% end -%>
|
47
|
+
|
40
48
|
void solve() {
|
49
|
+
<% if pbm.options.interactive -%>
|
41
50
|
printf("! %s\n", ans);
|
42
51
|
fflush(stdout);
|
43
52
|
#ifdef DEBUG
|
@@ -47,48 +56,26 @@ void solve() {
|
|
47
56
|
puts(responses[i].c_str());
|
48
57
|
}
|
49
58
|
#endif
|
59
|
+
<% elsif (vs = pbm.options.binary_values) -%>
|
60
|
+
bool cond = false;
|
61
|
+
puts(cond ? "<%= vs[0] %>" : "<%= vs[1] %>");
|
62
|
+
<% else -%>
|
63
|
+
int ans = 0;
|
64
|
+
printf("%d\n", ans);
|
65
|
+
<% end -%>
|
50
66
|
}
|
51
67
|
|
52
68
|
void input() {
|
53
|
-
<% gen_inputs.each do |
|
54
|
-
|
55
|
-
|
69
|
+
<% gen_inputs.each do |line| -%>
|
70
|
+
<%= line %>
|
71
|
+
<% end -%>
|
72
|
+
<% if pbm.options.interactive -%>
|
73
|
+
#ifdef DEBUG
|
56
74
|
scanf("%s", source);
|
57
75
|
#endif
|
58
|
-
|
59
|
-
<%
|
60
|
-
else
|
61
|
-
%>
|
62
|
-
#include <cstdio>
|
63
|
-
|
64
|
-
using namespace std;
|
65
|
-
|
66
|
-
#define REP(i,n) for(int i=0; i<(int)(n); i++)
|
67
|
-
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
|
68
|
-
|
69
|
-
<% gen_consts.each do |const| %><%= const %>
|
70
|
-
<% end %>
|
71
|
-
<% gen_decls.each do |dcl| %><%= dcl %>
|
72
|
-
<% end %>
|
73
|
-
void solve() {
|
74
|
-
<%
|
75
|
-
if (vs = pbm.options.binary_values)
|
76
|
-
%> bool cond = false;
|
77
|
-
puts(cond ? "<%= vs[0] %>" : "<%= vs[1] %>");<%
|
78
|
-
else
|
79
|
-
%> int ans = 0;
|
80
|
-
printf("%d\n", ans);<%
|
81
|
-
end
|
82
|
-
%>
|
76
|
+
<% end -%>
|
83
77
|
}
|
84
78
|
|
85
|
-
void input() {
|
86
|
-
<% gen_inputs.each do |input| %> <%= input %>
|
87
|
-
<% end
|
88
|
-
%>}
|
89
|
-
<%
|
90
|
-
end
|
91
|
-
%>
|
92
79
|
int main() {
|
93
80
|
input();
|
94
81
|
solve();
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# <%= pbm.url %>
|
2
|
-
|
3
|
-
if pbm.options.interactive
|
4
|
-
%>
|
2
|
+
|
3
|
+
<% if pbm.options.interactive -%>
|
5
4
|
def query(*args)
|
6
5
|
puts "? #{args.join(' ')}"
|
7
6
|
STDOUT.flush
|
@@ -15,15 +14,23 @@ end
|
|
15
14
|
|
16
15
|
$DEBUG = true
|
17
16
|
|
18
|
-
<%
|
19
|
-
<%
|
20
|
-
|
21
|
-
<% end
|
17
|
+
<% end -%>
|
18
|
+
<% gen_consts.each do |line| -%>
|
19
|
+
<%= line %>
|
20
|
+
<% end -%>
|
21
|
+
|
22
|
+
<% gen_decls.each do |line| -%>
|
23
|
+
<%= line %>
|
24
|
+
<% end -%>
|
25
|
+
<% if pbm.options.interactive -%>
|
26
|
+
|
22
27
|
if $DEBUG
|
23
28
|
@responses = []
|
24
29
|
@source = gets.chomp
|
25
30
|
end
|
31
|
+
<% end -%>
|
26
32
|
|
33
|
+
<% if pbm.options.interactive -%>
|
27
34
|
puts "! #{ans}"
|
28
35
|
STDOUT.flush
|
29
36
|
|
@@ -33,18 +40,9 @@ if $DEBUG
|
|
33
40
|
puts "query results:"
|
34
41
|
@responses.each { |res| puts res }
|
35
42
|
puts "----------------------------------------"
|
36
|
-
end<%
|
37
|
-
else
|
38
|
-
%>
|
39
|
-
<% gen_consts.each do |const| %><%= const %>
|
40
|
-
<% end %>
|
41
|
-
<% gen_decls.each do |dcl| %><%= dcl %>
|
42
|
-
<% end %>
|
43
|
-
<%
|
44
|
-
if (vs = pbm.options.binary_values)
|
45
|
-
%>puts cond ? '<%= vs[0] %>' : '<%= vs[1] %>'<%
|
46
|
-
else
|
47
|
-
%>puts ans<%
|
48
|
-
end
|
49
43
|
end
|
50
|
-
|
44
|
+
<% elsif (vs = pbm.options.binary_values) -%>
|
45
|
+
puts cond ? '<%= vs[0] %>' : '<%= vs[1] %>'
|
46
|
+
<% else -%>
|
47
|
+
puts ans
|
48
|
+
<% end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: at_coder_friends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nejiko96
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: launchy
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.4.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.4.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -135,6 +135,9 @@ executables:
|
|
135
135
|
extensions: []
|
136
136
|
extra_rdoc_files: []
|
137
137
|
files:
|
138
|
+
- ".gitattributes"
|
139
|
+
- ".github/workflows/codeql-analysis.yml"
|
140
|
+
- ".github/workflows/ruby.yml"
|
138
141
|
- ".gitignore"
|
139
142
|
- ".rspec"
|
140
143
|
- ".rubocop.yml"
|
@@ -197,6 +200,7 @@ metadata:
|
|
197
200
|
homepage_uri: https://github.com/nejiko96/at_coder_friends
|
198
201
|
source_code_uri: https://github.com/nejiko96/at_coder_friends
|
199
202
|
changelog_uri: https://github.com/nejiko96/at_coder_friends/blob/master/CHANGELOG.md
|
203
|
+
rubygems_mfa_required: 'true'
|
200
204
|
post_install_message:
|
201
205
|
rdoc_options: []
|
202
206
|
require_paths:
|
@@ -205,15 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
209
|
requirements:
|
206
210
|
- - ">="
|
207
211
|
- !ruby/object:Gem::Version
|
208
|
-
version: 2.
|
212
|
+
version: 2.5.0
|
209
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
214
|
requirements:
|
211
215
|
- - ">="
|
212
216
|
- !ruby/object:Gem::Version
|
213
217
|
version: '0'
|
214
218
|
requirements: []
|
215
|
-
|
216
|
-
rubygems_version: 2.5.2.3
|
219
|
+
rubygems_version: 3.1.6
|
217
220
|
signing_key:
|
218
221
|
specification_version: 4
|
219
222
|
summary: AtCoder support tool
|