init and a1

This commit is contained in:
0x01FE 2025-01-28 15:20:04 -06:00
commit 32b04527ab
10 changed files with 195 additions and 0 deletions

21
CPTTRN3/main.py Normal file
View File

@ -0,0 +1,21 @@
def main():
lines: list[str] = []
t = int(input())
while (t != 0):
lines.append(input())
t -= 1
for line in lines:
h, w = [int(n) for n in line.split()]
for y in range(h):
print('*' * ((w * 3) + 1))
row = '*..' * w + '*'
print(row)
print(row)
print('*' * ((w * 3) + 1))
print()
if __name__ == "__main__":
main()

BIN
DIVSUM/a.out Executable file

Binary file not shown.

37
DIVSUM/dumb.cpp Normal file
View File

@ -0,0 +1,37 @@
#include <cstdio>
#include <iostream>
#include <cmath>
int main() {
int t;
std::scanf("%d", &t);
while (t--) {
int n;
std::scanf("%d", &n);
if (n == 1) {
std::cout << "0" << std::endl;
continue;
}
int total = 1;
int r = (int) std::floor(std::sqrt(n));
for (int n2 = 2; n2 < r + 1; n2++) {
if (n % n2 == 0) {
int other = n / n2;
if (other != n)
total += other;
total += n2;
}
}
std::cout << total << std::endl;
}
return 0;
}

23
DIVSUM/main.py Normal file
View File

@ -0,0 +1,23 @@
def main():
lines: list[str] = []
t = int(input())
while (t != 0):
lines.append(input())
t -= 1
print()
for line in lines:
n = int(line)
if n == 1:
print(0)
continue
total = 1
for n2 in reversed(range(2, n)):
total += n2 if n % n2 == 0 else 0
print(total)
if __name__ == "__main__":
main()

27
DIVSUM/test.py Normal file
View File

@ -0,0 +1,27 @@
d = {1 : 0}
def main():
lines: list[str] = []
t = int(input())
while (t != 0):
lines.append(input())
t -= 1
print()
for line in lines:
n = int(line)
if n == 1:
print(0)
continue
total = 1
for n2 in reversed(range(2, n)):
total += n2 if n % n2 == 0 else 0
print(total)
if __name__ == "__main__":
main()

36
DIVSUM/timed.cpp Normal file
View File

@ -0,0 +1,36 @@
#include <cstdio>
#include <iostream>
#include <stdlib.h>
#include <cmath>
int main() {
int t = 200000;
// std::scanf("%d", &t);
while (t--) {
int n;
// std::scanf("%d", &n);
n = std::rand() % 500000 + 1;
if (n == 1) {
std::cout << "0" << std::endl;
continue;
}
int total = 1;
int r = (int) std::floor(std::sqrt(n));
for (int n2 = 2; n2 < r + 1; n2++) {
if (n % n2 == 0)
total += n2 + (n/n2);
// std::cout << n2 << std::endl;
}
std::cout << total << std::endl;
}
return 0;
}

15
STRHH/main.py Normal file
View File

@ -0,0 +1,15 @@
def main():
lines = []
t = int(input())
while (t != 0):
lines.append(input())
t -= 1
# Do Problem
for line in lines:
for char in range(0, len(line)//2, 2):
print(line[char], end='')
print()
if __name__ == "__main__":
main()

5
STRHH/test.text Normal file
View File

@ -0,0 +1,5 @@
4
your
progress
is
noticeable

19
TEST/main.cpp Normal file
View File

@ -0,0 +1,19 @@
#include <cstdio>
#include <iostream>
int main() {
while (1) {
int n;
std::scanf("%d", &n);
if (n == 42) {
break;
}
std::cout << n << std::endl;
}
return 0;
}

12
TEST/main.py Normal file
View File

@ -0,0 +1,12 @@
def main():
while True:
n = int(input())
if n == 42:
break
print(n)
if __name__ == '__main__':
main()