This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
typedef struct Node { | |
int value; | |
struct Node *next; | |
} Node; | |
typedef struct Circle { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs; | |
use std::io; | |
use std::str::FromStr; | |
#[derive(Debug, Clone)] | |
enum Pattern { | |
Char { | |
c: u8, | |
}, | |
And { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs; | |
use std::io; | |
use std::str::FromStr; | |
#[derive(Debug, Clone)] | |
enum Pattern { | |
Char { | |
c: u8, | |
}, | |
And { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::{HashMap, HashSet}; | |
use std::convert::Into; | |
use std::fs; | |
use std::io; | |
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | |
struct Point { | |
d: [i64; 4], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::{HashMap, HashSet}; | |
use std::convert::Into; | |
use std::fs; | |
use std::io; | |
#[derive(Debug, Clone, PartialEq, Eq, Hash)] | |
struct Point { | |
d: [i64; 4], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
use regex::Regex; | |
use std::fs; | |
use std::str::FromStr; | |
use std::convert::Into; | |
use std::ops::RangeInclusive; | |
use std::collections::{HashMap, VecDeque}; | |
type Ticket = Vec<u32>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
use std::fs; | |
use std::str::FromStr; | |
use std::convert::TryInto; | |
use std::collections::HashMap; | |
#[derive(Debug, Clone)] | |
enum Instruction { | |
Mask(u64, u64, u64), | |
Set(u64, u64), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use regex::Regex; | |
use std::io; | |
use std::ops::RangeInclusive; | |
use std::fs; | |
use std::collections::HashMap; | |
use std::str::FromStr; | |
fn match_re(re: &str, text: &str, captured_range: Option<RangeInclusive<i32>>) -> bool { | |
Regex::new(re).ok().and_then(|re| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs::File; | |
use std::io::{BufRead, BufReader, Result}; | |
use std::collections::HashSet; | |
type Grid = (i32, isize, isize); | |
fn load_grid(path: &str) -> Result<Grid> { | |
let f = File::open(path)?; | |
let f = BufReader::new(f); |
NewerOlder