-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpp files updated, removed ### in some questions, add questions, remo…
…ved unsolved
- Loading branch information
1 parent
1004520
commit 417cf13
Showing
66 changed files
with
676 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# آلفا قنطورس | ||
# ID : 66859 | ||
# https://quera.org/problemset/66859/ | ||
# https://b2n.ir/d99346 | ||
|
||
|
||
def NumberToChar(number): | ||
if 0 <= number <= 9: | ||
return chr(ord('0') + number) | ||
|
||
else: | ||
return chr(ord('A') + number - 10) | ||
|
||
|
||
def baseConverter(keeper, number, base): | ||
if base == 10: | ||
return str(number) | ||
|
||
else: | ||
while True: | ||
if number > 0: | ||
keeper += NumberToChar(number % base) | ||
number = int(number / base) | ||
else: | ||
break | ||
|
||
return keeper[::-1] | ||
|
||
|
||
n, b = input().split(" ") | ||
print(baseConverter(keeper="", number=int(n), base=int(b))) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# بدخواه مردم | ||
# ID : 2706 | ||
# https://quera.org/problemset/2706/ | ||
# https://b2n.ir/z93074 | ||
|
||
m, n = map(int, input().split()) | ||
|
||
if m % 2 == 0: | ||
print("white") | ||
|
||
else: | ||
print("black") |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
int main() | ||
{ | ||
int a,b,c,d,e; | ||
cin>>a>>b; | ||
d=a; | ||
e=b; | ||
while(b>0){ | ||
c=a%b; | ||
a=b; | ||
b=c; | ||
|
||
int main() { | ||
int n, m, n1, m1, b; | ||
cin >> n >> m; | ||
if (n > m){ | ||
int temp = m; | ||
m = n; | ||
n = temp; | ||
} | ||
cout<<a<<" "<<(d*e)/a<<endl; | ||
|
||
n1 = n; | ||
m1 = m; | ||
|
||
while (m > 0) { | ||
b = n % m; | ||
n = m; | ||
m = b; | ||
} | ||
|
||
cout << n << " " << (n1 * m1) / n; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
n1, m1 = n, m | ||
while m > 0: | ||
print(m, n) | ||
b = n % m | ||
n = m | ||
m = b | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,3 @@ | |
keeper = keeper + str(i) | ||
|
||
print(keeper[k - 1]) | ||
|
||
########################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
int main(){ | ||
int n,fact; | ||
fact=1; | ||
|
||
int main() { | ||
int n, fact; | ||
fact = 1; | ||
cin >> n; | ||
|
||
while (n>0) | ||
{ | ||
fact = fact*n; | ||
n=n-1; | ||
while (n > 0) { | ||
fact = fact * n; | ||
n = n - 1; | ||
} | ||
cout<<fact<<endl; | ||
cout << fact << endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# فرزاد کارکن | ||
# ID : 658 | ||
# https://quera.org/problemset/658/ | ||
# https://b2n.ir/m57632 | ||
|
||
import numpy | ||
|
||
a = int(input()) | ||
b = [int(t) for t in input().split()] | ||
|
||
if max(b) <= 0: | ||
print(0) | ||
|
||
else: | ||
h = [max(b)] | ||
|
||
for i in range(2, a): | ||
for j in range(0, (a - (i)) + 1): | ||
h.append(numpy.sum([b[k] for k in range(j, j + i)])) | ||
|
||
print(max(h)) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# همه ی زیرمجموعه ها | ||
# ID : 12912 | ||
# https://quera.org/problemset/12912/ | ||
# https://b2n.ir/e36183 | ||
|
||
from collections import deque | ||
|
||
h = [] | ||
|
||
def printPowerSet(S, i, out=deque()): | ||
if i < 0: | ||
po = list(out) | ||
po.sort() | ||
h.append(po) | ||
return | ||
|
||
out.append(S[i]) | ||
printPowerSet(S, i - 1, out) | ||
out.pop() | ||
|
||
while i > 0 and S[i] == S[i - 1]: | ||
i = i - 1 | ||
|
||
printPowerSet(S, i - 1, out) | ||
|
||
|
||
def findPowerSet(S): | ||
S.sort() | ||
printPowerSet(S, len(S) - 1) | ||
|
||
|
||
haaayyyyy = int(input()) | ||
s = [int(u) for u in range(1, haaayyyyy + 1)] | ||
printPowerSet(s, haaayyyyy - 1) | ||
h.sort() | ||
|
||
for k in h: | ||
st = str(k) | ||
st = st.replace("[", "{") | ||
st = st.replace("]", "}") | ||
print(st) | ||
|
||
########################################################### | ||
|
||
def sebSequence(number, step, keep, continuee): | ||
if step > number: | ||
return | ||
|
||
if continuee: | ||
printer(keep) | ||
|
||
keep.append(step + 1) | ||
sebSequence(number, step + 1, keep, True) | ||
|
||
keep.pop() | ||
sebSequence(number, step + 1, keep, False) | ||
|
||
|
||
def printer(keep): | ||
temp = [] | ||
for i in range(len(keep)): | ||
temp.append(keep[i]) | ||
|
||
text = '{' + f'{", ".join([str(i) for i in temp])}' + '}' | ||
print(text) | ||
|
||
|
||
number = int(input()) | ||
keep = [] | ||
sebSequence(number, 0, keep, True) |
Binary file not shown.
Oops, something went wrong.
417cf13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect
417cf13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😁🌺