five

isavita/advent-of-code

收藏
Hugging Face2024-07-21 更新2024-03-04 收录
下载链接:
https://hf-mirror.com/datasets/isavita/advent-of-code
下载链接
链接失效反馈
官方服务:
资源简介:
该数据集包含了从2015年开始的Advent of Code编程挑战的解决方案和相关数据。数据包括任务描述、输入数据、正确答案、解决方案代码以及使用的编程语言。数据集的结构化格式使得可以轻松分析和比较不同解决方案和语言。
提供机构:
isavita
原始信息汇总

Advent of Code Solutions Dataset

简介

该数据集包含自2015年以来的Advent of Code编程谜题的解决方案和输入数据。Advent of Code是一系列每年举办的编程挑战,可以用任何语言解决。目前,数据集包含所有Go编写的解决方案和许多PythonJavaScriptJavaScalaKotlinGroovyClojureC#F#SwiftObjective-CRHaskellOcamlRacketRubyErlangElixirRustCC++ZigFortran90PerlPascalCrystalJuliaLuaPHPDartBashAWKNimDCoffeScriptTypeScript编写的解决方案。

数据集结构

  • 所有年份的Advent of Code谜题存储在一个名为"train.json"的单一数据集中。
  • 每个条目包含:
    • 谜题名称(例如,"day1_part1_2017")
    • 谜题任务的完整文本
    • 谜题提供的输入数据
    • 谜题的正确答案(例如,"1914")
    • 解决方案的完整代码
    • 用于解决方案的编程语言(例如,"go")
    • 谜题的年份(例如,2017)

数据字段

每个条目包含以下字段:

  • name: 挑战的唯一标识符,格式为"dayX_partY_YEAR"(例如,"day1_part1_2017")。
  • task: 挑战的详细描述。
  • input: 挑战提供的输入数据。
  • answer: 正确答案,以字符串形式表示(例如,"1914")。
  • solution: 挑战的完整解决方案代码。
  • solution_lang: 用于解决方案的编程语言(例如,"go")。
  • year: 挑战的年份(例如,2017)。

示例条目

json { "name": "day1_part1_2017", "task": "--- Day 1: Inverse Captcha --- The night before Christmas, one of Santas Elves calls you in a panic. "The printers broken! We cant print the Naughty or Nice List!" By the time you make it to sub-basement 17, there are only a few minutes until midnight. "We have a big problem," she says; "there must be almost fifty bugs in this system, but nothing else can print The List. Stand in this square, quick! Theres no time to explain; if you can convince them to pay you in stars, youll be able to--" She pulls a lever and the world goes blurry.

When your eyes can focus again, everything seems a lot more pixelated than before. She must have sent you inside the computer! You check the system clock: 25 milliseconds until midnight. With that much time, you should be able to collect all fifty stars by December 25th.

Collect stars by solving puzzles. Two puzzles will be made available on each day millisecond in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!

Youre standing in a room with "digitization quarantine" written in LEDs along one wall. The only door is locked, but it includes a small interface. "Restricted Area - Strictly No Digitized Users Allowed."

It goes on to explain that you may only leave by solving a captcha to prove youre not a human. Apparently, you only get one millisecond to solve the captcha: too fast for a normal human, but it feels like hours to you.

The captcha requires you to review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list.

For example:

1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit. 1111 produces 4 because each digit (all 1) matches the next. 1234 produces 0 because no digit matches the next. 91212129 produces 9 because the only digit that matches the next one is the last digit, 9. What is the solution to your captcha?", "input": "111831362354551173134957758417849716877188716338227121869992652972154651632296676464285261171625892888598738721925357479249486886375279741651224686642647267979445939836673253446489428761486828844713816198414852769942459766921928735591892723619845983117283575762694758223956262583556675379533479458964152461973321432768858165818549484229241869657725166769662249574889435227698271439423511175653875622976121749344756734658248245212273242115488961818719828258936653236351924292251821352389471971641957941593141159982696396228218461855752555358856127582128823657548151545741663495182446281491763249374581774426225822474112338745629194213976328762985884127324443984163571711941113986826168921187567861288268744663142867866165546795621466134333541274633769865956692539151971953651886381195877638919355216642731848659649263217258599456646635412623461138792945854536154976732167439355548965778313264824237176152196614333748919711422188148687299757751955297978137561935963366682742334867854892581388263132968999722366495346854828316842352829827989419393594846893842746149235681921951476132585199265366836257322121681471877187847219712325933714149151568922456111149524629995933156924418468567649494728828858254296824372929211977446729691143995333874752448315632185286348657293395339475256796591968717487615896959976413637422536563273537972841783386358764761364989261322293887361558128521915542454126546182855197637753115352541578972298715522386683914777967729562229395936593272269661295295223113186683594678533511783187422193626234573849881185849626389774394351115527451886962844431947188429195191724662982411619815811652741733744864411666766133951954595344837179635668177845937578575117168875754181523584442699384167111317875138179567939174589917894597492816476662186746837552978671142265114426813792549412632291424594239391853358914643327549192165466628737614581458189732579814919468795493415762517372227862614224911844744711698557324454211123571327224554259626961741919243229688684838813912553397698937237114287944446722919198743189848428399356842626198635297851274879128322358195585284984366515428245928111112613638341345371", "answer": "1044", "solution": "package main

import ( "fmt" "os" "strings" )

func main() { data, err := os.ReadFile("input.txt") if err != nil { fmt.Println("File reading error", err) return }

input := strings.TrimSpace(string(data))
sum := 0

for i := 0; i < len(input); i++ {
	next := (i + 1) % len(input)
	if input[i] == input[next] {
		sum += int(input[i] - 0)
	}
}

fmt.Println(sum)

}", "solution_lang": "go", "year": 2017 }

数据集扩展

数据集目前包含2015年至2023年的数据,并计划扩展到更多年份和编程语言。随着新年份的增加,数据集结构将保持一致。

许可证

  • 许可证:Apache 2.0

贡献

欢迎对该数据集进行贡献,特别是添加不同编程语言的解决方案或未覆盖年份的解决方案。请确保您的提交遵循现有的数据集结构和格式。

联系

如有任何疑问或贡献,请通过PR或联系isavitaisa@gmail.com。

5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作