import { useState } from "react"; import { Link } from "react-router-dom"; import { Search } from "lucide-react"; import Layout from "@/components/Layout"; import InteractiveCard from "@/components/InteractiveCard"; import GridTilingPuzzle from "@/components/GridTilingPuzzle"; import SunnyLinesPuzzle from "@/components/SunnyLinesPuzzle"; interface Interactive { id: string; title: string; description: string; tags: string[]; component: React.ComponentType; greenScreenPath: string; } const interactives: Interactive[] = [ { id: "grid-tiling-puzzle", title: "Grid Tiling Puzzle", description: "Based on IMO 2025: Place rectangular tiles on a grid so that each row and column has exactly one uncovered square.", tags: ["puzzle", "geometry", "optimization", "imo", "contest-problems"], component: GridTilingPuzzle, greenScreenPath: "/contest-problems/grid-tiling" }, { id: "sunny-lines-puzzle", title: "Sunny Lines Puzzle", description: "Based on IMO 2025 P6: Place lines to cover points in a triangle. A line is 'sunny' if it's not parallel to x-axis, y-axis, or x+y=0.", tags: ["puzzle", "geometry", "lines", "imo", "contest-problems"], component: SunnyLinesPuzzle, greenScreenPath: "/contest-problems/sunny-lines" } ]; const ContestProblems = () => { const [searchTerm, setSearchTerm] = useState(""); const [selectedInteractive, setSelectedInteractive] = useState(null); const filteredInteractives = interactives.filter(interactive => interactive.title.toLowerCase().includes(searchTerm.toLowerCase()) || interactive.description.toLowerCase().includes(searchTerm.toLowerCase()) || interactive.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase())) ); if (selectedInteractive) { const InteractiveComponent = selectedInteractive.component; return (
Back to Themes →
); } return (
← Back to Themes

Contest Problems

Practice with problems from programming competitions, mathematical olympiads, and algorithmic challenges with interactive solutions and explanations.

setSearchTerm(e.target.value)} className="w-full pl-10 pr-4 py-2 border border-outline rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" />
{filteredInteractives.map(interactive => ( setSelectedInteractive(interactive)} /> ))}
{filteredInteractives.length === 0 && (

No interactives found matching "{searchTerm}"

)}
); }; export default ContestProblems;