text:
Memory Allocator
You're designing a new esoteric programming language and
one feature you've decided to add is a dynamic memory allocator. Your language specifies a special dedicated virtual address space for the user's program space. This is separate from the address space used by the memory allocator for any internal state.
To help reduce the cost of distributing your implementation the size of the code must be as small as possible.
Interface
You must provide three functions: initialization, allocate, and deallocate.
Initialization
This function takes a single positive integer parameter N. This means a user's program has N bytes in its address space from which there are N-1 bytes to allocate memory from. The address 0 is reserved for "null".
It is guaranteed that this function will be called exactly once before any allocate/deallocate calls.
Note that this function does not need to allocate any physical memory for the user program's virtual address space; you're basically creating the "look and feel" of a hollow memory allocator.
Allocate
The allocate function must take a request of the number of bytes of memory to allocate. The input is guaranteed to be positive.
Your function must return an integer address to the start of the allocated block, or 0 to denote that there is no contiguous block of the requested size available. If a contiguous block of the available size is available anywhere in the address space you must allocate!
You must ensure that no two allocated blocks overlap.
Deallocate
The deallocate function must take an address of the start of an allocated block, and optionally may also take the size of the given block.
Memory that has been deallocated is available again for allocation. It is assumed that the input address is a valid address.
Example Python implementation
Note that you may choose any method for keeping track of internal state; in this example the class instance keeps track of it.
class myallocator:
    def __init__(self, N):
        # address 0 is special, it's always reserved for null
        # address N is technically outside the address space, so use that as a
        # marker
        self.addrs = [0, N]
        self.sizes = [1, 0]

    def allocate(self, size):
        for i,a1,s1,a2 in zip(range(len(self.addrs)),
                                 self.addrs[:-1], self.sizes[:-1],
                                 self.addrs[1:]):
            if(a2 - (a1+s1) >= size):
                # enough available space, take it
                self.addrs.insert(i+1, a1+s1)
                self.sizes.insert(i+1, size)
                return a1+s1
        # no contiguous spaces large enough to take our block
        return 0

    def deallocate(self, addr, size=0):
        # your implementation has the option of taking in a size parameter
        # in this implementation it's not used
        i = self.addrs.index(addr)
        del self.addrs[i]
        del self.sizes[i]

Scoring
This is code golf; shortest code in bytes wins. You need not worry about running out of memory for any internal state required by your allocator.
Standard loop holes apply.
Leaderboard

var QUESTION_ID=67895,OVERRIDE_USER=31729;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

I doubt Python lists take up exactly one byte per element. Does the "allocated memory" have to be in bytes, or can it just be "your language's generic array/list type"?

No actual allocation is required (except for whatever you want for internal state tracking, which is on its own virtual address space); you're only returning integers to some abstract finite virtual address space.

To help reduce the cost of distributing your implementation the size of the code must be as small as possible or could it be efficient (small and efficient are not same) as possible? :D

Huh, [tag:language-design]?

While this challenge is motivated with a language design background, designing a language is not actually part of the task (rather implementing parts of one), so I've removed the tag.

JavaScript (ES6), 88
Using a global variable _ (a very sparse array) to keep track.
Now how could I test it?
I=n=>(_=[1],_[n]=0)
A=n=>_.some((x,i)=>i-p<n?(p=i+x,0):_[p]=n,p=1)?p:0
D=p=>delete _[p]

Ruby, 80
i,a,d=->n{$m=?o*n},->n{$m.sub!(/\B#{?o*n}/,?f*n);"#$`".size},->n,s{$m[n,s]=?o*s}

Like MegaTom's answer, but uses a string instead of an array to store state. The "o" character denotes an open cell, while an "f" denotes a filled one. This lets us use Ruby's relatively terse string manipulation functions:
?o*n initializes a string of n "o"s.
/\B#{?o*n}/ is a regular expression matching n consecutive "o"s that doesn't include the first character.
sub! replaces the first match with n "f"s.
"#$`" gives the string to the left of the match, or an empty string if there was no match, so the size is either the allocated index or 0.
Deallocate just sets the designated section of the string back to "o"s.

Ruby, 135
Has a global array keep track of whether each cell is allocated or not.
i=->n{$a=[!0]*n;$a[0]=0}
a=->n{s=$a.each_cons(n).to_a.index{|a|a.none?};n.times{|i|$a[s+i]=0}if s;s||0}
d=->s,n{n.times{|i|$a[s+i]=!0}}

Mathematica, 152
i=(n=#;l={{0,1},{#,#}};)&
a=If[#=={},0,l=l~Join~#;#[[1,1]]]&@Cases[l,{Except@n,e_}:>{e,e+#}/;Count[l,{a_,_}/;e<=a<e+#]<1,1,1]&
d=(l=l~DeleteCases~{#,_};)&

n store the total size, l stores the internal state. The allocator will try to allocate right behind another section of allocated memory.


text:
Staircase Program
The challenge is simple: given two parameters, x and y, output y staircases with x steps. For example:
f(3,1) - 1 staircase with 3 steps.
    _
  _|
_|

f(5,2) - 2 staircases with 5 steps.
        _         _
      _|        _|
    _|        _|
  _|        _|
_|        _|

Make sure you output the staircases just like, this and that there is no extra space between staircases. Note that there is one empty line at the top.
But there's a twist. We are going to use a special kind of scoring called staircase scoring. In staircase scoring, as long as the character code (in the encoding your language uses) of each character is higher than the previous character you don't accumulate any points. You get a 1 point penalty for using a character with a code that is less than or equal to that of the previous character. Lowest score wins.
E.g. (Assume we are using Unicode).

"abcd" - 0 points (every character is higher than the previous)
"bbbb" - 3 points (the three last b's are not higher than the first)
"aBcD" - 2 points (remember that in ASCII lowercase letters have higher values than uppercase letters).
"™©" - 1 point (in Unicode the TM symbol has a value of 8482, where as the copyright symbol has value of 169.)

You can use the following snippet to check your score, as well as get the Unicode values of different characters, using the "Show Codes" toggle. (Note: This snippet scores using the Javascript UTF-16 encoding. It will break up some complex characters into multiple surrogate characters. If you do not want this, you must score yourself.) :

function showCodes() {
  if(!check.checked) return;
  var val = program.value;
  var c = "";
  for(var i = 0;i<val.length;i++) {
    c+= val.charCodeAt(i) + " ";
  }
  codes.textContent = c;
}

function toggle() {
  if(!check.checked) codes.textContent = "";
  else showCodes();
}

function getScore() {
  var val = program.value;
  var score = 0;
  for(var i = 0;i<val.length-1;i++) {
    score += val[i+1] <= val[i];
  }
  alert(score);
}
<textarea rows=10 cols=40 id="program" oninput="showCodes()"></textarea>
<input type="submit" value="Get Score" onclick="getScore()" /> Show Codes<input type="checkbox" id="check" onchange="toggle()" />

Notes:

The input values x and y will always be > 0

Judging from the last note, will the input numbers always be < 10?

@Doᴡɴɢᴏᴀᴛ Oh yeah. The answer is no. Let me just take that line out.

This seems... biased to languages which make liberal and gratuitous use of UTF-8+

@cat well if there's a language that can get a score of 0 id like to see it.

I'm not complaining, but I'm sure TeaScr-- yeah, or CJam.

Pretty sure Lenguage can easily get a score of 0, perhaps there should be a way of implementing byte-length into the score?

@Doᴡɴɢᴏᴀᴛ I doubt that. In all revisions of the Unicode standard, there are less than 4.3 billion characters.

Headsecks is a particularly good 0 score candidate. I dislike writing Brainfuck code, so I'll leave it to someone else.

Downvoting because I  dislike the scoring system.

You would have had my upvote if you had restricted this to 1 byte characters, typically ascii.

@Stewie Smart. This is what happens when you try to be nice, after my last challenge was ASCII only.

As lowest score wins, wouldn't it be clearer to express the scoring examples as + x points rather than - x points?

Headsecks - 0 points
I took up @Mauris' idea. I didn't want to actually do this in brainfuck, so I used bfbasic.
Here is the Basic program:
INPUT A
INPUT B

A=A-2
B=B-2

J=0
DO
    I=0
    DO
        IF I=0 THEN
            IF A-J>1 THEN
                K=0
                DO
                    PRINT "  ";
                    K=K+1
                LOOP WHILE K<A-J-1
            END IF

        ELSE
            K=0
            DO
                PRINT "  ";
                K=K+1
            LOOP WHILE K<A-1

            IF J=0 THEN
                PRINT " ";
            END IF
        END IF

        IF J=0 THEN
            PRINT "_";
        ELSE
            PRINT "_|";
        END IF

        I=I+1
    LOOP WHILE I<B
    PRINT

    J=J+1
LOOP WHILE J+<+[>[>[-]+<-]>[<+>>>>>>>>>>>[-]<<<<<<<<<+[->,.----------[<+>>++++++[<------>-]>>>>>>>[<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>>>>[<<<<+>>>>-]<[<<<<<<+>+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]<[>>>>>>>-<<<<<<<[-]]>>>[-]>>>>[>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<->>>>>>>>>>[-]]<<<<<<<<<-]<[>[-]+<-]>[<+>>++++++++++.[-]<<<->>-]<<]

I finished it by using this Python script in conjunction with Multilang's headsecks implementation:
import headsecks

m=0
with open(input()) as p:
 p=p.read().strip()
c="+-<>.,[]"
h=""

for i in p:
 h+=chr(c.index(i)+8*m)
 m+=1

with open('h.hs', 'w') as x:
 x.write(h)

headsecks.execute(h)

And ended up with this headsecks program (It works in the snippet):
https://gist.github.com/anonymous/d956240df995f3cd7d86
xxd dump:
https://gist.github.com/anonymous/67e1fed9e53a770bb770

CJam, 2 points
"qžɟ̬вխتܯࡗथ੻୾భ൓๟༫ဢቼጢᐿᕽᙦᜥᠺᥳᩗ᭦᰼ᵓṦἫK≎〉"127f&~

Try it here.
It takes a long ascending UTF-8 string, gets all character values modulo 128, then evaluates it as CJam code. Removing the final ~ reveals the "real" program hiding underneath:
q~_,2m*/W%{~-S_+"_|"?}f%:sWf<Sf+f*N*

Which might not even be a very good golf, but luckily it doesn't matter. ^^
Saved a point thanks to Dennis!

Python 2, 25 points
Following Mauris' approach of unicode character conversion:
exec ''.join([chr(ord(unicode(c))%256) for c in u'dťɦ̠ѨԨٳܬ࡮ऩ਺ଊఠ൰๲ཀྵၮᅴሠ፮ᐪᔨᘧᜠᠧᤪᨲᬪᱳᴫḧὟ‧℩∊⌠⑦╯♲✠⡫⤠⩩⭮Ⱐ⵲⹡⽮でㅥ㈨㍳㐩㔺㘊㜠㠠㥰㩲㭩㱮㵴㸠㽮䀪䄨䈧䌠䐧䔪䘨䜲䠪䥳䨭䬲䰪䵫中伲倩儫刧卟呼唧嘫圧堠大娪嬨尲崪幫弫怱愩戩'])

Example input and output:
h(5,2)

          _          _
        _|         _|
      _|         _|
    _|         _|
  _|         _|
_|         _|

h(3,1)

      _
    _|
  _|
_|

Vyxal j, Score 5
ƛd‛_|↳¹d↲Ṫ⁰*;Ṙ

Try it Online!
Using the Vyxal codepage, score is 5.

TeaScript, 33 points
r(x)vm#pR(l*2)+"_"+(g=l==a.n-1?p:"|")+(pR(x*2-2)+"_"+g)R(y-1))j(n

This is unusually long because TeaScript 3 is fairly new and contains many bugs, especially with unicode shortcuts which kills the score.
Try it online

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
In a string or not?
Recently I've been having some trouble with the new TeaScript interpreter. The biggest problem is identifying whether or not a string contains any special characters.

Challenge
A special character is defined as a character with codepoint 160 to 255. You will be given an input which is a string of characters with codepoints 0 to 255, at most one of which is a special character. The input will consist of a prefix of zero or more characters, a quoted string, and a suffix of zero or more characters. If there is a special character in the quoted string you should output a truthy value, otherwise a falsey value.
Details

The characters "' are considered quotes.
Inside the quoted string, a backslash \ will be used to escape the following character. In the prefix and suffix, it has no special meaning.
Quotes will always be balanced.
There will only be one quoted string.

Examples
"Hello, World¡"
true

"Hello, World"¡
false

"Hello' Wo\"rld\\"¡
false

ab"cd\"ef\\gh\i\\"£
false

\"foo¡"
true

This could use a test case where the Unicode character is escaped.

Also test cases that actually use ' strings and multiple strings in a single test case (ideally with the Unicode character between them).

@MartinBüttner One of the rules is that "There will only be one set of quotes" but +1 for the other test case ideas.

@user81655 oh right, I overlooked that. That simplifies things.

"Because there are only 1,114,112 characters in unicode, your code will need to be as short as possible" ................ I have no words for your golfing justifications.

I think I can just about work out what you're asking for, but the question almost seems designed to confuse.

Retina, 19 17 bytes
Thanks to user81655 for saving 2 bytes.
Byte count uses ISO 8859-1.
['"].*[¡-ÿ].*['"]

Output is 0 or 1.
Try it online.
Explanation
Due to the assumptions of the challenge, the first ' or " will start the only string of the input and the last ' or " ends it. We also don't need to worry about them being the same because they are guaranteed to be the same anyway.
Therefore, the regex just tries to find a character with code point 161 to 255, inclusive, which is preceded by one quote and followed by another. There will always be either 0 or 1 match.

Won't this give a false positive for "abc"¡'? (I guess depending on how you read the OP, that bare single quote can never occur in an input, but technically there is only one set of quotes in this input.)

@Mauris the spec says that quotes will always be balanced.

Here's another 17-byte solution: (['"]).*[¡-ÿ].*\1. It happens to be more practical.

@ןnɟuɐɯɹɐןoɯ yeah, I considered that one, but figured it was overkill, given the assumptions of the challenge. ¯\(ツ)/¯

Note: This can be done with a simple regular expression. s=>s.match`['"].*[¡-ÿ].*['"]` is 29 bytes in JavaScript, but it's more fun without regular expressions:
JavaScript (ES6), 84 82 bytes
s=>[...s].map((c,i)=>q?i<s.lastIndexOf(q)&c>" "?r=1:s:c=="'"|c=='"'?q=c:0,q=r=0)|r

Explanation
Returns 1 for true and 0 for false. The " " in the code below is a U+00A0 NO-BREAK SPACE (code point 160).
s=>
  [...s].map((c,i)=>     // for each character c in the string
    q?
      i<s.lastIndexOf(q) // if we are still inside the string
        &c>" "?r=1       // and c is a "unicode character", set the result to 1 (true)
      :s                 // returning s for false guarantees that the array returned by map
                         //     will cast to NaN, which allows us to use |r instead of &&r
    :c=="'"|c=='"'?      // if we are starting a string
      q=c                // set the end of string character
    :0,
    q=                   // q = end string character
      r=0,               // initialise r to 0 (false)
  )|r                    // return r

Test

var solution = s=>[...s].map((c,i)=>q?i<s.lastIndexOf(q)&c>" "?r=1:s:c=="'"|c=='"'?q=c:0,q=r=0)|r
<input type="text" id="input" value='ab"cd\"ef\\gh\i\\"£' />
<button onclick="result.textContent=solution(input.value)">Go</button>

Does it handle the backspace to escape quotes?

What do you mean? You could test it using the test snippet.

Right. It does in fact

Oh, your regex is even shorter than my two-stage Retina solution. Do you mind if I use it?

@MartinBüttner Go ahead. It's pretty much the same anyway.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Using Symbols for Letters
Input: A single word as a string (matches [a-zA-Z]+).  If the input doesn't follow these guidelines, print "Error" (but no error should be thrown)
Output: The NATO pronunciation of the word.  Print out a space separated list of the NATO word that matches each letter of the input word.  Trailing white space is acceptable.
Restrictions:
Your source code must contain each ASCII character from 32 (space) to 126 (tilde) in that order, excluding numbers and letters.  You may have anything you like mingled in between the required characters, but the required characters must be there and in order. (If ABC were the required characters, YA8iBC3 or C6ABn#C would be valid, but A7CRT or 8mdB9AC would not be).
Standard loopholes and built-ins for generating the NATO pronunciation are not allowed.
References:
The NATO pronunciation is as follows: Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey Xray Yankee Zulu.
The required symbols (in order) are as follows: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Test cases: (The quotation marks won't be part of input, but are included to show whitespace)
"a"            => Alpha
"Z"            => Zulu
"twig"         => Tango Whiskey India Golf
"PPCG"         => Papa Papa Charlie Golf
"camelCase"    => Charlie Alpha Mike Echo Lima Charlie Alpha Sierra Echo
"Quebec"       => Quebec Uniform Echo Bravo Echo Charlie
""             => Error
" "            => Error
"()"           => Error
"twig "        => Error
" PPCG"        => Error
"one+two"      => Error
"Queen bee"    => Error

This is a code-golf, so the shortest code in your favorite language wins!

+1 for the basic challenge idea but -1 for the (in my opinion) odd and unnecessary restrictions.

Wtf those strange restrictions?.. What's the use of making !"#$%&'()*+,-./:;<=>?@[\]^_\{|}~` required?

@AlexA. The restrictions are the core of the challenge.  The rest of the challenge is simply the framework to present the restriction.

Let's say wed have met the requirement while writing the source code, can we use those characters afterwards?

Yes.  You can use the symbols as many times as you'd like.

Really? They use Golf? Weird..

JavaScript (ES6), 268
An anonymous function
i=>[...i].every(c=>(c=parseInt(c,36))>9?o+="AlphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu".match(/[A-Z][^A-Z]+/g)[c-10]+' ':0,o='',!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~")?o:'Error'

Ruby, 343 bytes
puts gets.chop.chars.map!{|c|"AlphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu"[/#{c.upcase}[a-z]+/]||$$%0&0}*' 'rescue(puts"Error")#*+,-./:;<=>?@[\]^_`{|}~

Tried incorporating as many of the required characters as possible, but after a while it was shorter to just put them in a comment at the end.  For readability, here's the non-comment part with the long string taken out:
puts gets.chop.chars.map!{|c|"AlphaBravo..."[/#{c.upcase}[a-z]+/]||$$%0&0}*' 'rescue(puts"Error")

That's a space and all the characters !"#$%&'() in the right order without comments

Can get it to 197 these days, using the normal codegolf rules about functions.
x.chars.map{"AlphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu"[/#{_1.upcase}[a-z]+/]||1/0}*' 'rescue"Error"

Attempt this online!

Oops, 227. Forgot about the silly requirement.

05AB1E, 151 150 146 145 143 135 bytes
!áмg_ilA”¤±Ð†vo¼¯¤œ®È¨›trotŠˆƒ‹Š™ÈŸt Kilo´àma—……ÍÐ—Žêpa¼°«Äoµ†Çâgo¸šÉµ Whiskey Xrayµ‹nkeeâ¸lu”#ð«‡ë”‰ë”q"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

-8 bytes implicitly thanks to @ErikTheGolfer's comment here for a better compressed string (only difference is Alpha vs Alfa).
Try it online or verify all test cases.
Explanation:
!              # Take the factorial of the (implicit) input
               # (This will leave the input-string unchanged if it isn't an integer)
 áм            # Remove all letters
   g_i         # If the length of the remainder is 0:
      l        #  Make the (implicit) input lowercase
       A       #  Push the lowercase alphabet
       ”¤±Ð†vo¼¯¤œ®È¨›trotŠˆƒ‹Š™ÈŸt Kilo´àma—……ÍÐ—Žêpa¼°«Äoµ†Çâgo¸šÉµ Whiskey Xrayµ‹nkeeâ¸lu”
               #  Push string "Alpha Bravo Charlie ... Yankee Xray Zulu"
        #      #  Split the string by spaces:
               #   ["Alpha","Bravo","Charlie",...,"Yankee","Xray","Zulu"]
         ð«    #  Append each with a space:
               #   ["Alpha ","Bravo ","Charlie ",...,"Yankee ","Xray ","Zulu "]
       ‡       #  Transliterate; map all letters in the lowercase input with this
               #  list at the same indices (and output the result implicitly)
     ë         # Else:
      ”‰ë”     #  Push the dictionary word "Error"
          q    # Stop the program (and output the "Error" at the top of the stack implicitly)
           "#$%&'()*+,-./:;<=>?@[\]^_`{|}~
              "# Push the string "#$%&'()*+,-./:;<=>?@[\]^_`{|}~",
               # which is a no-op since the program has already stopped

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why ”¤±Ð†vo¼¯¤œ®È¨›trotŠˆƒ‹Š™ÈŸt Kilo´àma—……ÍÐ—Žêpa¼°«Äoµ†Çâgo¸šÉµ Whiskey Xrayµ‹nkeeâ¸lu” is "Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey Xray Yankee Zulu" and ”‰ë” is "Error".

CJam, 173 bytes
qeu:M'[,65>:L- !{M'Af-L"{;ege& \@IQ#5~wUNxuznY_E+TLsBTC9\$8
]%9b    Y9&G~|Yedz9?7pLD&&6PNg[vXY4D}Q"127b26b'`f+'`/.+f=S*}"Error"?e#()*+,-./:;<=>?@[\]^_`{|}~

Contains lots of unprintable characters. Try it out here.

PHP, 268 bytes
Same byte count as the JavaScript answer. :) I couldn't find a byte-saving way around the "penalty" of adding the special char string as is:
for(;$c=ucfirst($argv[1][$i++]);"!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~")preg_match("/{$c}[a-z]+/",AlphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu,$m)?$o.="$m[0] ":die(Error);echo$o;

Takes an input from command line, like:
$ php tango.php Word

Ungolfed
for(;$c=ucfirst($argv[1][$i++]);"!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~")
    preg_match("/{$c}[a-z]+/",AlphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu,$m) ?
        $o.="$m[0] " :
        die(Error);
echo$o;

x86 machine code, IBM PC DOS, 274 bytes
a080 0032 e4fe c8be 8100 03f0 8bc8 8bd8 b805 008e c0fd ac24 dfbf 0800 51b1 a4fc
f2ae 5975 064f 57e2 eceb 07ba af00 52bb 0100 8cc0 8ed8 b409 8bcb 5acd 21ba b400
cd21 e2f6 b44c cd21 416c 7068 6124 4272 6176 6f24 4368 6172 6c69 6524 4465 6c74
6124 4563 686f 2446 6f78 7472 6f74 2447 6f6c 6624 486f 7465 6c24 496e 6469 6124
4a75 6c69 6574 244b 696c 6f24 4c69 6d61 244d 696b 6524 4e6f 7665 6d62 6572 244f
7363 6172 2450 6170 6124 5175 6562 6563 2452 6f6d 656f 2453 6965 7272 6124 5461
6e67 6f24 556e 6966 6f72 6d24 5669 6374 6f72 2457 6869 736b 6579 2458 7261 7924
5961 6e6b 6565 245a 756c 7524 2122 2345 7272 6f72 2024 2526 2728 292a 2b2c 2d2e
2f3a 3b3c 3d3e 3f40 5b5c 5d5e 5f60 7b7c 7d7e

Ungolfed:
.DATA
NATO    DB  'Alpha$Bravo$Charlie$Delta$Echo$Foxtrot$Golf$Hotel$India$'
        DB  'Juliet$Kilo$Lima$Mike$November$Oscar$Papa$Quebec$Romeo$'
        DB  'Sierra$Tango$Uniform$Victor$Whiskey$Xray$Yankee$Zulu$'
LNATO   EQU $-NATO
        DB  '!"#'           ; required string part 1
ERRSTR  DB  'Error'         ; Error string
SEPSTR  DB  ' $'             ; word separator string
        DB  '%&',"'()*+,-./:;<=>?@[\]^_`{|}~" ; required string part 2
.CODE
    MOV  AL, DS:[80H]       ; DS:80H is length of input string from command line
    XOR  AH, AH             ; clear AH
    DEC  AL                 ; command line arg length includes preceeding space
    MOV  SI, 81H            ; look in DS:82H-1 for start of string
    ADD  SI, AX             ; start at end of string
    MOV  CX, AX             ; search length of input string
    MOV  BX, AX             ; BL is length of input to search
    MOV  AX, @DATA          ; Initialize ES to CODE segment
    MOV  ES, AX             ; align ES pointer (leave DS pointing to PSP)
SEARCH:
    STD                     ; set dir flag (search backwards)
    LODSB                   ; load next char from DS:SI into AL, advance SI
    AND  AL, 0DFH           ; uppercase the input letter
    MOV  DI, OFFSET NATO    ; re-point SCASB to beginning of word data
    PUSH CX                 ; save outer loop position
    MOV  CL, LNATO          ; CL = length of NATO word data
    CLD                     ; clear dir flag (search forward)
    REPNE SCASB             ; search until key in AL is found ES:DI, advance DI
    POP  CX                 ; restore outer loop counter
    JNZ  SHORT ERROR        ; if REPNE ends without ZF, no value was found
    DEC  DI                 ; un-advance DI to start of found string
    PUSH DI                 ; save position for later output
    LOOP SEARCH
    JMP  SHORT OUTPUT
ERROR:
    MOV  DX, OFFSET ERRSTR  ; error string
    PUSH DX                 ; push to top of stack
    MOV  BX, 1              ; only output this one below
OUTPUT:
    MOV  AX, ES             ; get data segment from ES
    MOV  DS, AX             ; point DS for DOS API string output
    MOV  AH, 09H            ; display string function
    MOV  CX, BX             ; loop for number of input letters
OUT_LOOP:
    POP  DX                 ; get pointer to next word from stack
    INT  21H
    MOV  DX, OFFSET SEPSTR  ; display a space between words
    INT  21H
    LOOP OUT_LOOP
EXIT:
    MOV  AH, 4CH            ; exit to DOS
    INT  21H

Reads input from command line, displays output to console.
Implementation notes: In order to prevent any otherwise valid words from being displayed before the Error string, the searching and screen output are separate. The input string is searched end to beginning since the stack (LIFO) is used to hold the output words (otherwise they'd be displayed in reverse).
Output:
A>SYMLET a
Alpha
A>SYMLET Z
Zulu
A>SYMLET twig
Tango Whiskey India Golf
A>SYMLET PPCG
Papa Papa Charlie Golf
A>SYMLET camelCase
Charlie Alpha Mike Echo Lima Charlie Alpha Sierra Echo
A>SYMLET Quebec
Quebec Uniform Echo Bravo Echo Charlie
A>SYMLET
Error
A>SYMLET " "
Error
A>SYMLET ()
Error
A>SYMLET "twig "
Error
A>SYMLET PPCG
Error
A>SYMLET one+two
Error
A>SYMLET Queen bee
Error

This is very impressive, nice job.

Japt, 188 bytes
The compressed string is littered with unprintables, so I've replaced each with a ¿. Try it online!
V=Um@`Alp¿B¿voC¿r¦eDeltaE®oFoxÉ¿GolfHÇUI¿iaJªietKiloL¿aMikeNovem¼rOs¯rPapaQue¼cRo´oSi¿¿TangoUnif¿mVÅ¡rW¿skeyX¿yY¿keeZªu`fXu +"[a-z]+" +S};!Uf"[ !#$%&'()*+,-./:;<=>?@[\\]^_`\{|}~]" ?V:`Er¿r
                                                                                ^    ^  ^   ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^

The top line is the actual code; the bottom line points out each of the required characters. I was lucky to find a way to put every one of them to good use, especially the backslash, which would have been needed there even if it was not required.
I could save four bytes by using JS's atob to compress the string, instead of Japt's built-in Oc, but the transpiler inserts an extra parenthesis due to this bug.
V=Um@     }; // Set variable V to: map each character X in U to:
`...`f       //  Take the long string, decompress it, and match:
Xu +"[a-z]+" //   the uppercase version of X, followed by multiple lowercase letters.
+S           //  Take the resulting match and add a space.
             // All this results with "Alpha Bravo Charlie" for an input of "Abc", or
             // "Alpha Bravo null" for something like "Ab!".
 Uf"..."     // Match any of the characters in this string in the input.
!        ?   // If the result is null (none were matched):
V            //  output V.
:"Error      // Otherwise, output "Error".

Python 279 276 bytes
It would have been much shorter than the odd requirement.
EDIT: I just learned that s.split(' ')==s.split()
#!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
x=raw_input().lower();a=''
l="Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey Xray Yankee Zulu".split()
for i in x: a+=l[ord(i)-97]+' '
print a

I commented out the requirement. I used ord() to find the index position of the letter in l.
Try it here!

It doesn't matter for this challenge, but note that ''.split(' ') is [''] but ''.split() is [].