g | x | w | all
Bytes Lang Time Link
071Python 3231206T111654Zguest430
024APLDyalog Unicode250616T085751ZMat_rdv
043Perl 5 ap241107T204307ZXcali
nanedit saving one byte with a loop231207T121543ZEvargalo
066AWK231211T132021ZMarius_C
045JavaScript Node.js231204T132603Zl4m2
056C gcc231205T120746ZNoodle9
035APL+WIN231205T111825ZGraham
014Vyxal 3231205T085339ZNick Ken
012Jelly231204T200256ZJonathan
01505AB1E231204T153443ZFlummox
01505AB1E231204T144359ZKevin Cr
024Charcoal231204T150841ZNeil
027K ngn/k231204T142918Zovs

Python 3, 85 72 71 bytes

-13 bytes since I saw answers to other questions use a function
-1 byte from @Adamátor: if abs(x)<=v -> if-v<=x<=v

lambda x:[a for a in range(68)for b in range(a)if-.5<=x-100*b/a<=.5][0]

try it online!, or see all the numbers

pre-golf:

x=int(input())
for a in range(68):        # for all denominators (starting from lowest)
 for b in range(a):        # and numerators (bonus, doesn't let /0 through)
  if abs(x-100*b/a)<=.5:   # is it within rounding range, up or down?
   print(a)                # then print the denominator
   exit()                  # anything else will be bigger

credit to oeis for sequence and formula

APL(Dyalog Unicode), 24 bytes SBCS

{2⊃∊⍸⍵=⌊.5+100×∘.÷⍨⍳100}

Try it on APLgolf!

Explanation

Because of rounding the result is not greater than 100, thus it is possible to check every pair \$(m,n)\$ (\$m\$ responders agreed from total of \$n\$). Moreover, the minimal suitable \$n\$ would be paired with the minimal suitable \$m\$ ( because if \$m_1 \leq m_2\$ and \$n_1 \geq n_2\$, hence \$\frac{m_1}{n_1} \leq \frac{m_2}{n_2}\$).

                   ⍳100    numbers from 1 to 100
                  ⍨       Selife: use the argument as both left and right arguments of a dyadic function
                 ÷        Divide
               ∘.         Outer product
               ∘.÷⍨⍳100    division table for numbers from 1 to 100
           100×           Multiply by 100          
       ⌊.5+               idiom: Round to the nearest integer (add 0.5 and round the result down (⌊))
      =                   Equals: compares a scalar value with each element of the matrix
     ⍵                    the right argument (x)
    ⍸                     Where: finds indices (i.e. pairs (m,n)) of all 1 in the matrix; indices are listed by the lexicographic order
   ∊                      Enlist: list all elements of the vector of pairs as one vector in order
 2⊃                       Pick the second element (the minimal suitable n)

Perl 5 -ap, 43 bytes

(grep.5>=abs"@F"-100*$_/$\,1..++$\)||redo}{

Try it online!

edit: saving one byte with a loop

R, 52 bytes

f=\(n){x=1;while(all(abs(n-100*(1:x)/x)>.5))x=x+1;x}

Try it online!


Previous solution, recursive

R, 53 bytes

f=\(n,x=1)`if`(all(abs(n-100*(1:x)/x)>.5),f(n,x+1),x)

Try it online!

AWK, 66 bytes

{for(;i++<99;)for(j=0;j++<r=i;)if(.5>=(n=$1-100*j/i)&&n>=-.5)next}

Try it online!

JavaScript (Node.js), 45 bytes

x=>g=i=>(x-i%69/(y=i>>7)*100)**2<.26?y:g(-~i)

Try it online!

C (gcc), 56 bytes

i;j;f(n){for(i=j=1;fabs(100.*j/i-n)>.5;j=--j?:++i);j=i;}

Try it online!

APL+WIN, 35 bytes

Prompts for input:

⌊/(⎕=(⌈n-.5),⌊.5+n←100×÷m)/m,m←⍳100

Try it online! Thanks to Dyalog Classic

Vyxal 3, 14 bytes

₅Dᵒ÷×ṚTȧd1≤ᶤaꜝ

Try it Online!

Takes an integer argument and returns an integer argument. This is a Vyxal 3 translation of @JonathanAllan’s Jelly answer. It’s two bytes longer, partly because the outer modifier returns the result in the transposed reverse of what is needed for this problem.

₅Dᵒ÷×ṚTȧd1≤ᶤaꜝ­⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁤​‎‎⁡⁠⁣⁡‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌­
₅               # ‎⁡100
 D              # ‎⁢Triplicate
  ᵒ÷            # ‎⁣Outer divide by using (100..1),(100..1)
    ×           # ‎⁤Multiply (by 100)
     Ṛ          # ‎⁢⁡Reverse
      T         # ‎⁢⁢Transpose
       ȧ        # ‎⁢⁣Absolute difference with main input
        d       # ‎⁢⁤Double
         1≤     # ‎⁣⁡Less than or equal to 1
           ᶤa   # ‎⁣⁢Find first where any true
             ꜝ  # ‎⁣⁣Increment by 1
💎

Created with the help of Luminespire.

Jelly,  14  12 bytes

-2 thanks to Nick Kennedy! (Make a 100 by 100 table with values over 100% rather than a triangle of values.)

ạȷ2÷þפḤỊ§TḢ

A monadic Link that accepts a positive integer from \$[1,100]\$, the reported percentage, and yields another positive integer, the minimal number of respondents.

Try it online! Or see all 100.

How?

ạȷ2÷þפḤỊ§TḢ - Link: positive intger from [1..100], P
      ¤      - nilad followed by link(s) as a nilad:
 ȷ2          -   10^2 -> 100
    þ        -   {[1..100]} x {[1..100]} table of:
   ÷         -     divide
     ×       -   multiply by {100} (vectorises)
                 -> [[100],[50.0,100],[33.33,66.66,100],[25.0,50.0,75.0,100],...]
ạ            - {P} absolute difference (vectorises) {that}
       Ḥ     - double (vectorises)
        Ị    - is insignificant? (vectorises) - i.e. abs(x)<=1
         §   - sums
          T  - truthy indices
           Ḣ - head

05AB1E, 15 bytes

∞.ΔDÝs/т*α2zs@à

Try it online!

Explanation:

∞        Push infinite list
.Δ       Find first item in list where:
    D    Duplicate item
    Ý    Create an array 0-N
    s/   Switch last two and divide
    т*   Multiply by 100
    α    Absolute difference (input is automatically in stack)
    2zs  Push 0.5 before the last item
    @    Compare 0.5 with list (>=)
à        Check if the list contains 1

05AB1E, 15 bytes

∞.ΔтLт*s/α2zs@à

Try it online or verify all outputs.

Explanation:

∞                # Push an infinite positive list: [1,2,3,...]
 .Δ              # Pop and find the first/smallest that's truthy for:
   тL            #  Push a list in the range [1,100]
     т*          #  Multiply each by 100: [100,200,...,10000]
       s/        #  Divide each by the current integer
         α       #  Get the absolute difference of each with the (implicit) input
          2zs@   #  Check for each whether it's <= 0.5:
          2      #   Push 2
           z     #   Pop and push 1/2
            s    #   Swap so the list is at the top
             @   #   >= check
              à  #  Pop and check if any in the list is truthy
                 # (after which the result is output implicitly)

Charcoal, 24 bytes

NθI⌊Φφ∧ιΦφ¬‹·⁵↔⁻θ∕×λ¹⁰⁰ι

Try it online! Link is to verbose version of code. Very slow as it does about 1,000 times as much work as necessary. Explanation: Uses the OEIS formula.

Nθ                          First input as a number
     φ                      Predefined variable `1000`
    Φ                       Filter on implicit range
       ι                    Current value
      ∧                     Logical And
         φ                  Predefined variable `1000`
        Φ                   Filter on implicit range
                   λ        Inner value
                  × ¹⁰⁰     Multiplied by `100`
                 ∕          Divided by
                       ι    Outer value
              ↔⁻            Absolute difference with
                θ           Input number
          ¬‹·⁵              Is less than or equal to `0.5`
   ⌊                        Take the minimum
  I                         Cast to string
                            Implicitly print

K (ngn/k), 27 bytes

**&~`i$(199*%/:/&=69)-1.99*

Try it online!

Based on the formula from the OEIS entry:

Find the smallest N such that there is some x > 0 with abs(100*x/N - n) <= 0.5.

For golfing reasons this actually checks -1 < 1.99*(100*x/N - n) < 1, which happens to be equivalent on the domain of the problem.