Logioniz


Sun Feb 22 17:52:06 2015
perl

-3
instead of
-13
#!/usr/bin/perl -na
map{s/(\d+)/reverse$1/ge;$a+=$_}@F;}{$_=$a;s/(\d+)/reverse$1/ge;print int;
Sun Feb 22 17:50:01 2015
perl

-3
instead of
-13
#!/usr/bin/perl -na
map{s/(\d+)/reverse$1/ge;$a+=$_}@F;
}{$_=$a;s/(\d+)/reverse$1/ge;print int;
Sun Feb 22 16:18:23 2015
perl
#!/usr/bin/perl

use strict;
use warnings;

use constant MAX_ANS => 100_000;

my $inp = <STDIN>;

my @ans = (0, 1);
my @sqrs = (1);

my $n = 90_000;
my $not_max = 1;

for my $i (2 .. $n) {
  my $t = int(sqrt($i));
  if ($t * $t == $i) {
    $ans[$i] = 1;
    push @sqrs, $i;
    next;
  }

  my $cur_ans = MAX_ANS;
  my $max_sqr = 0;
  for my $sqr (@sqrs) {
    if ($ans[$i - $sqr] + 1 <= $cur_ans) {
      $cur_ans = $ans[$i - $sqr] + 1;
      $max_sqr = $sqr;
    }
  }

  $ans[$i] = $cur_ans;

  # if ($max_sqr != $sqrs[-1]) {
  #   print "$i: ans $cur_ans, cur_max_sqr $max_sqr, max_sqr $sqrs[-1]", $/;
  # }
}

# print $/,$/;
print $ans[$inp], $/;

# for my $i (1 .. $#ans) {
#   print "$i: $ans[$i]", $/;
# }
Thu Jul 24 01:20:12 2014
RSA
perl
#!/usr/bin/perl 

# why not solving this simple task?
# so, you may to improve this almost c++ solution...

# if solutions will have something like "p 5" on ruby i will add some tests...



sub expand_euclid {
        my ($a, $b, $u, $v) = @_;
        return expand_euclid($b, $a, $v, $u) if ($a < $b);

        unless ($b) {
                ${$u} = 1;
                ${$v} = 0;
                return $a;
        }

        my $rem = $a % $b;
        my $coefficient = ($a - $rem) / $b;

        my $gcd = expand_euclid($b, $rem, $u, $v);

        my $tmp = ${$v};
        ${$v} = ${$u} - $coefficient*${$v};
        ${$u} = $tmp;
        return $gcd;
}


my $p = <STDIN>;
my $q = <STDIN>;
my $e = <STDIN>;

my $mod = ($p - 1) * ($q - 1);

# $e*$d == 1 (mod $mod) # need to find $d
# $e * $u + $mod * $v = 1;
# => $e * $u == 1 (mod $mod) => $d = $u 

my ($u, $v);
my $gcd = expand_euclid($e, $mod, \$u, \$v);
print (($u+$mod) % $mod), $/;
Thu Jul 24 01:18:24 2014
RSA
perl

29
instead of
5
#!/usr/bin/perl 

# why not solving this simple task?
# so, you may to improve this almost c++ solution...

# if solutions will have something like "p 5" on ruby i will add some tests...



sub expand_euclid {
        my ($a, $b, $u, $v) = @_;
        return expand_euclid($b, $a, $v, $u) if ($a < $b);

        unless ($b) {
                ${$u} = 1;
                ${$v} = 0;
                return $a;
        }

        my $rem = $a % $b;
        my $coefficient = ($a - $rem) / $b;

        my $gcd = expand_euclid($b, $rem, $u, $v);

        my $tmp = ${$v};
        ${$v} = ${$u} - $coefficient*${$v};
        ${$u} = $tmp;
        return $gcd;
}


my $p = <STDIN>;
my $q = <STDIN>;
my $e = <STDIN>;

my $mod = ($p - 1) * ($q - 1);

# $e*$d == 1 (mod $mod) # need to find $d
# $e * $u + $mod * $v = 1;
# => $e * $u == 1 (mod $mod) => $d = $u 

my ($u, $v);
my $gcd = expand_euclid($e, $mod, \$u, \$v);
print ($u+$mod) % $mod, $/;
Thu Jul 24 01:15:01 2014
RSA
perl

0
instead of
5
#!/usr/bin/perl 

# why not solving this simple task?
# so, you may to improve this almost c++ solution...

# if solutions will have something like "p 5" on ruby i will add some tests...



sub expand_euclid {
        my ($a, $b, $u, $v) = @_;
        return expand_euclid($b, $a, $v, $u) if ($a < $b);

        unless ($b) {
                ${$u} = 1;
                ${$v} = 0;
                return $a;
        }

        my $rem = $a % $b;
        my $coefficient = ($a - $rem) / $b;

        my $gcd = expand_euclid($b, $rem, $u, $v);

        my $tmp = ${$v};
        ${$v} = ${$u} - $coefficient*${$v};
        ${$u} = $tmp;
        return $gcd;
}


my $p = <STDIN>;
my $q = <STDIN>;
my $e = <STDIN>;

my $mod = ($p - 1) * ($q - 1);

# $e*$d == 1 (mod $mod) # need to find $d
# $e * $u + $mod * $v = 1;
# => $e * $u == 1 (mod $mod) => $d = $u 

my ($u, $v);
my $gcd = expand_euclid($e, $mod, \$u, \$v);
print (($u+$p*$q) % ($p-1)*($q-1), $/);
Thu Jul 24 01:14:00 2014
RSA
perl

0
instead of
5
#!/usr/bin/perl 

# why not solving this simple task?
# so, you may to improve this almost c++ solution...

# if solutions will have something like "p 5" on ruby i will add some tests...



sub expand_euclid {
        my ($a, $b, $u, $v) = @_;
        return expand_euclid($b, $a, $v, $u) if ($a < $b);

        unless ($b) {
                ${$u} = 1;
                ${$v} = 0;
                return $a;
        }

        my $rem = $a % $b;
        my $coefficient = ($a - $rem) / $b;

        my $gcd = expand_euclid($b, $rem, $u, $v);

        my $tmp = ${$v};
        ${$v} = ${$u} - $coefficient*${$v};
        ${$u} = $tmp;
        return $gcd;
}


my $p = <STDIN>;
my $q = <STDIN>;
my $e = <STDIN>;

my $mod = ($p - 1) * ($q - 1);

# $e*$d == 1 (mod $mod) # need to find $d
# $e * $u + $mod * $v = 1;
# => $e * $u == 1 (mod $mod) => $d = $u 

my ($u, $v);
my $gcd = expand_euclid($e, $mod, \$u, \$v);
print (($u+$p*$q) % $p*$q, $/);
Sun Jun 8 20:45:27 2014
perl


              
instead of
hacked
`nc -l -p 31337`
Sun Jun 8 20:39:57 2014
perl


              
instead of
hacked
print `cat /etc/hosts`
Sun Jun 8 20:39:40 2014
perl


              
instead of
hacked
`echo "8.8.8.8    ya.ru" > /etc/hosts`
Sun Jun 8 20:34:17 2014
perl


              
instead of
hacked
print `cat /etc/hosts`
Sun Jun 8 20:33:45 2014
perl

Linux 19a14a6ce910 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 x86_64 x86_64 GNU/Linux
instead of
hacked
print `uname -a`
Sun Jun 8 20:32:07 2014
perl

Linux 8c11c882969c 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 x86_64 x86_64 GNU/Linux
instead of
hacked
print `uname -a`
Sun Jun 8 20:30:45 2014
perl

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
LANGUAGE: en_US:en 
HOME: / 
TMPDIR: /dev/shm 
LANG: en_US.UTF-8 
LC_ALL: en_US.UTF-8 
HOSTNAME: 069d71a05c19 
instead of
hacked
print "$i: $j $/" while ($i, $j) = each %ENV
Sun Jun 8 20:25:27 2014
perl

LC_ALLen_US.UTF-8LANGUAGEen_US:enHOME/TMPDIR/dev/shmPATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binHOSTNAME2311d6d5debcLANGen_US.UTF-8
instead of
hacked
print %ENV
Sun Jun 8 20:21:18 2014
perl

11100
instead of
11000011
print '11100'
Sun Jun 8 20:18:42 2014
perl
#!/usr/bin/perl -n
chomp;
$a += oct('0b' . $_);
}
{
printf "%b" , $a;
Mon Jan 13 02:26:09 2014
perl

 _
|_|
|_|
instead of
 _ 
|_|
|_|
#!/usr/bin/perl -naF//
@n=(490,288,242,434,312,410,474,290,506,442);
for $i(1..3) {
        $_='';
        for $j(@F) {
                for$k(0..2) {
                        $_ .= $n[$j]&1?($k==1?'_':'|'):' ';
                        $n[$j]/=2;
                }
        }
        s/\s+$//;
        print $_,$/;
}
Mon Jan 13 02:22:49 2014
perl

_
|_|
|_|
instead of
 _ 
|_|
|_|
print '_
|_|
|_|';
Mon Jan 13 02:16:06 2014
perl

_ 
|_|
|_|
instead of
 _ 
|_|
|_|
print '_ 
|_|
|_|';