Snippets
Created by
Willy Pillow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 4.4.0 #1 SMP Sun Jan 24 23:40:06 MST 2016 i686 i686 i686 GNU/Linux
ubuntu@ubuntu:~$ cat gen.scala
var i = 0
while (i < 1000000) {
println(scala.util.Random.nextInt)
i += 1
}
ubuntu@ubuntu:~$ scala gen.scala > input.txt
ubuntu@ubuntu:~$ cat gen2.scala
var i = 0
while (i < 10000000) {
println(scala.util.Random.nextInt)
i += 1
}
ubuntu@ubuntu:~$ scala gen2.scala > input2.txt
ubuntu@ubuntu:~$ cat printf.cpp
#include <cstdio>
int main() {
int parity = 0, x;
while (1 == scanf("%d", &x)) parity ^= x;
printf("%d", parity);
return 0;
}
ubuntu@ubuntu:~$ cat iostream.cpp
#include <iostream>
int main() {
int parity = 0, x;
std::cin.tie(0);
std::ios_base::sync_with_stdio(0);
while (std::cin >> x) parity ^= x;
std::cout << parity;
return 0;
}
ubuntu@ubuntu:~$ g++ --version
g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ubuntu@ubuntu:~$ g++ -lm -lmcrypt -O2 -std=c++11 -pipe -DONLINE_JUDGE -o printf printf.cpp
ubuntu@ubuntu:~$ g++ -lm -lmcrypt -O2 -std=c++11 -pipe -DONLINE_JUDGE -o iostream iostream.cpp
ubuntu@ubuntu:~$ time ./printf < input.txt
221426
real 0m0.497s
user 0m0.480s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./iostream < input.txt
221426
real 0m0.342s
user 0m0.336s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./printf < input.txt
221426
real 0m0.423s
user 0m0.416s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./iostream < input.txt
221426
real 0m0.347s
user 0m0.340s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./printf < input.txt
221426
real 0m0.420s
user 0m0.412s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./iostream < input.txt
221426
real 0m0.355s
user 0m0.344s
sys 0m0.008s
ubuntu@ubuntu:~$ time ./printf < input.txt
221426
real 0m0.421s
user 0m0.408s
sys 0m0.012s
ubuntu@ubuntu:~$ time ./iostream < input.txt
221426
real 0m0.357s
user 0m0.348s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./printf < input.txt
221426
real 0m0.422s
user 0m0.420s
sys 0m0.000s
ubuntu@ubuntu:~$ time ./iostream < input.txt
221426
real 0m0.356s
user 0m0.348s
sys 0m0.004s
ubuntu@ubuntu:~$ time ./printf < input2.txt
-816737107
real 0m5.779s
user 0m5.664s
sys 0m0.108s
ubuntu@ubuntu:~$ time ./iostream < input2.txt
-816737107
real 0m4.484s
user 0m4.388s
sys 0m0.096s
ubuntu@ubuntu:~$ time ./printf < input2.txt
-816737107
real 0m5.366s
user 0m5.308s
sys 0m0.056s
ubuntu@ubuntu:~$ time ./iostream < input2.txt
-816737107
real 0m5.113s
user 0m5.024s
sys 0m0.088s
ubuntu@ubuntu:~$ time ./printf < input2.txt
-816737107
real 0m5.367s
user 0m5.316s
sys 0m0.052s
ubuntu@ubuntu:~$ time ./iostream < input2.txt
-816737107
real 0m4.478s
user 0m4.416s
sys 0m0.060s
ubuntu@ubuntu:~$ time ./printf < input2.txt
-816737107
real 0m5.362s
user 0m5.280s
sys 0m0.080s
ubuntu@ubuntu:~$ time ./iostream < input2.txt
-816737107
real 0m5.097s
user 0m5.036s
sys 0m0.064s
ubuntu@ubuntu:~$ time ./printf < input2.txt
-816737107
real 0m5.356s
user 0m5.296s
sys 0m0.068s
ubuntu@ubuntu:~$ time ./iostream < input2.txt
-816737107
real 0m4.472s
user 0m4.408s
sys 0m0.068s
|
Comments (1)
You can clone a snippet to your computer for local editing. Learn more.
Uno de mis amigos me contó que había encontrado un sitio de juegos muy bueno en Chile, con el que había ganado dinero real. Yo también decidí probar a jugar en este sitio y también tuve la suerte de ganar dinero real. Nunca pensé que jugar pudiera ser tan interesante y divertido. Por eso voy a jugar en este sitio tan a menudo como pueda siempre que tenga tiempo libre.