[职通车]上海交大科研团队穿西装种草莓

14,425 questions
Filter by
Sorted by
Tagged with
6 votes
2 answers
40 views

Squaring the roots of a polynomial

In this challenge, you are given a polynomial \$p(x)\$, and you need to find a polynomial \$q(x)\$ whose roots are exactly the squares of the roots of \$p(x)\$ (counted with multiplicity). In other ...
alephalpha's user avatar
18 votes
9 answers
905 views

What's left after repeatedly removing palindromes

Sometimes a string has buried palindromes in it: hallolilah contains lol. And if we took out ...
Steve Bennett's user avatar
14 votes
4 answers
803 views

Identify Last-Layer Perm of a Rubik's Cube

A popular method for solving Rubik's cube consists of: solving its first two layers, by convention starting with the white side orienting the last layer's pieces so they face the same direction with ...
ngn's user avatar
  • 15.5k
1 vote
1 answer
230 views

The Parable of the Dagger Prelude

Taken from lesswrong.com Once upon a time, there was a court jester who dabbled in logic. The jester presented the king with two boxes. Upon the first box was inscribed: "Either this box ...
NeRoboto's user avatar
  • 268
-4 votes
3 answers
191 views

Print Today's Motto [closed]

Motto of the day (MOTD) or Today's Motto is a algorithm to generate a unique & dynamic motto for every day. Input of the date to calculate motto for could be in any reasonable format. The program ...
QOO-OOKALAN's user avatar
18 votes
7 answers
2k views

Seven-dimensional cross product

The cross product is a peculiarly 3-dimensional phenomenon. There are multiple ways of generalizing it, but each of them have trade offs. If you require that a cross product be a product of two ...
Wheat Wizard's user avatar
  • 102k
23 votes
15 answers
2k views

Write two very different programs with the same characters

Your task is to write two programs/functions, in the same language. Program 1: Verify that two inputs are anagrams of each other. Program 2: Verify that two inputs differ from each other at every ...
Steve Bennett's user avatar
6 votes
14 answers
1k views

Make a Mulenère encryption program

Mulenère cipher is a version of Vigenère ciphers, which uses multiplication instead of addition. Algorithm It's simple. First, the password will repeated as much as reach a size bigger than length of ...
QOO-OOKALAN's user avatar
2 votes
1 answer
146 views

Unstablizable LaTeX [closed]

from Latexmk: If you use cross-references, you often have to run LaTeX more than once ... Sometimes cross-referenced location changed and you need to run LaTeX again to create the correct reference. ...
InQβ's user avatar
  • 411
16 votes
8 answers
1k views

Output shortest string containing all input strings

Given a list of words (letters only) in no particular order, output the shortest string containing every word (disregarding case). Output must be lowercase, except the first letter of each word is ...
Steve Bennett's user avatar
2 votes
13 answers
534 views

List of prime distances

Task: Write a code golf program that, given two positive integers n and m, returns a list of the distances between consecutive prime numbers in the range [n, m] ...
JuanCa's user avatar
  • 361
34 votes
8 answers
4k views

Rig The Lottery, but Don't Get Caught

Edit: Please note there is currently a vote to close this coding challenge due to a complaint that it may be technically violating a decade old rule for this site. There is currently a discussion in ...
Albert Renshaw's user avatar
24 votes
6 answers
2k views

Computing Pi with iF*ck

Objective Compute \$\pi\$ using nothing but \$i\$ (\$\sqrt{-1}\$). Guidelines ONLY exponentiation and multiplication may be used (i.e. \$i^i\$ or \$ii\$) No additional symbols may be used (so no ...
WarpPrime's user avatar
  • 521
16 votes
12 answers
2k views

Who was leading the race?

Your goal is to find out the order of the drivers in a race (1st, 2nd, 3rd, etc) each time the start / finish line is crossed. This would allow someone to see the progression of a driver throughout ...
Ted's user avatar
  • 1,139
12 votes
3 answers
2k views

The shortest NP-complete problem

Find an NP-complete problem that covers all finite ASCII strings, and present a solver for the problem in the programming language of your choice. By the definition, if there is a finite ASCII string ...
Dannyu NDos's user avatar
  • 7,127

15 30 50 per page
1
2 3 4 5
962