Skip to content

Commit 63946a6

Browse files
committed
dd
1 parent d5d70c6 commit 63946a6

179 files changed

Lines changed: 21538 additions & 212 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

++.cpp

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* |\ | | ||\ \ /(_~ |~)|_~|\/||_~|\/||~)|_~|~)
2+
|~\|_|/\||~\ | ,_) |~\|__| ||__| ||_)|__|~\
3+
4+
\ //~\| | |\ |~)|_~ | ||\ ||/~\| ||_~
5+
| \_/\_/ |~\|~\|__ \_/| \||\_X\_/|__
6+
(J U S T L I K E E V E R Y O N E E L S E !)
7+
8+
__ ,..---.._
9+
+''''`--''-..`--..__
10+
.\ _,/:i--._`:-:+._`.``-._
11+
/`.._,,' \ `-.``--:.b....=.
12+
|`..__,,..`. '`.__::i--.-::_
13+
)- .....--i'\.. --+`'''-'
14+
,' .'.._,.-'|._-b\
15+
/,'<' V `oi| \ _.
16+
|/ -|,--.." ,'-. ||\.. _.,;:'_<'
17+
''/ | . ' |\||'\ /-'_/' `.
18+
|,','| , . .-.|:.`. + .,:.. |
19+
._,:'/ /-\ '^' -Y"\ |.| || /,+8d| |
20+
.|/,'| |/':: ':=:' ,'| | | \|| "+)=' |
21+
|+,';' /|_/ \ _/ \b':.\ \'| .|| ,'
22+
,,:-i''_i' | ``-.Y',. ,|`: | \;- | |_,'
23+
__ |'| |i:'._ ,' ,' ,; | |-)-' __--:b__
24+
.P| | |/,'|\ - ._ / / _,Y- ,:/' `. `'".._
25+
,'|| -','' | ._i._ `':| ,..,' ,Y;' \ `- ._
26+
|||||,.. | \ '-.._ _,' / _,b-' `. '-.
27+
||||P..i, .| '....,-' _,'''''-''' ' _,.. `\
28+
+'` <'/ |`-.....---' ._ ,._
29+
| | ,'``,:-''''/,--`.
30+
Y|.b_,,: | || ,;,Y' / |.
31+
,' /'----' .'| .. | | '" .`Y' .,-b_....;;,.
32+
|+|,' | | \., ' ,' `:. _ ,/__` _=: _,'``-
33+
/ +,' | /\_........:.' '"----:::::'Y .'.| |||
34+
|' ' .'/- \ /'|| || | |||
35+
||| /| \L /'|| ||/ | |||
36+
`.| ,'/ .| / ,'||/o;/ |||
37+
`..._,, | |/| ' |||
38+
``-' | |, |||
39+
| ,. | |||
40+
,=--------.... | "" | |||
41+
,/,'. i=..+._ ,.. '..;---:::''- | |
42+
'/| __....b `-''`---....../.,Y'''''j:.,.._ | `._
43+
.' _.Y.-' `.. ii:,'--------' | :-+. .| | b\
44+
| .=_,.---'''''--...:..--:' / _..-----..:= | | '|\
45+
| '-''`'--- ---'_,,,--'' `,.. | | \.
46+
\ . ,' _,--'' :dg: _,/ ||| | \
47+
`::b\` _,-i,-' ,..---' ,|:| | _|
48+
`'--.:-._ ____,,,;.,'' `--._ '''''''' |'|' .' '
49+
``'--....Y''-' `''--..._..____._____...,' | 'o-'
50+
`''''`'''i==_+=_=i__
51+
||'''- ' `.
52+
`-.......-''
53+
*/
54+
#include<bits/stdc++.h>
55+
using namespace std;
56+
57+
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
58+
#define LL long long
59+
#define mod 998244353
60+
#define FOR(i, j, k) for (int i=j ; i<k ; i++)
61+
#define ROF(i, j, k) for (int i=j ; i>=k ; i--)
62+
63+
const long long INF = 1e18;
64+
const long long MAX = 1e5+10;
65+
66+
int main(){
67+
fastio;
68+
int t=1; //cin>>t;
69+
while(t--){
70+
int n; cin>>n;
71+
double dp[n+1],p; dp[0]=1;
72+
double ans=0;
73+
FOR(i,1,n+1) {
74+
cin>>p;
75+
ROF(j,i,0){
76+
dp[i] =(i==0?0 : dp[i-1])*p + dp[i]*(1-p);
77+
}
78+
}
79+
80+
FOR(i,n/2 +1 ,n+1) ans+=dp[i];
81+
cout<<ans;
82+
}
83+
}

.vscode/settings.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
{
22
"files.associations": {
33
"iostream": "cpp",
4-
"*.tcc": "cpp"
4+
"*.tcc": "cpp",
5+
"array": "cpp",
6+
"bitset": "cpp",
7+
"string_view": "cpp",
8+
"initializer_list": "cpp",
9+
"regex": "cpp",
10+
"utility": "cpp",
11+
"valarray": "cpp",
12+
"deque": "cpp",
13+
"forward_list": "cpp",
14+
"list": "cpp",
15+
"string": "cpp",
16+
"unordered_map": "cpp",
17+
"unordered_set": "cpp",
18+
"vector": "cpp",
19+
"random": "cpp"
520
},
621
"competitive-programming-helper.firstTime": false
722
}

0.cpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// C++ program to build the smallest number by removing n digits from
2+
// a given number
3+
#include<iostream>
4+
#include<vector>
5+
using namespace std;
6+
7+
// A recursive function that removes 'n' characters from 'str'
8+
// to store the smallest possible number in 'res'
9+
void buildLowestNumberRec(string str, int n, string &res)
10+
{
11+
// If there are 0 characters to remove from str,
12+
// append everything to result
13+
if (n == 0)
14+
{
15+
res.append(str);
16+
return;
17+
}
18+
19+
int len = str.length();
20+
21+
// If there are more characters to remove than string
22+
// length, then append nothing to result
23+
if (len <= n)
24+
return;
25+
26+
// Find the smallest character among first (n+1) characters
27+
// of str.
28+
int minIndex = 0;
29+
for (int i = 1; i<=n ; i++)
30+
if (str[i] < str[minIndex])
31+
minIndex = i;
32+
33+
// Append the smallest character to result
34+
res.push_back(str[minIndex]);
35+
36+
// substring starting from minIndex+1 to str.length() - 1.
37+
string new_str = str.substr(minIndex+1, len-minIndex);
38+
39+
// Recur for the above substring and n equals to n-minIndex
40+
buildLowestNumberRec(new_str, n-minIndex, res);
41+
}
42+
43+
// A wrapper over buildLowestNumberRec()
44+
string buildLowestNumber(string str, int n)
45+
{
46+
string res = "";
47+
48+
// Note that result is passed by reference
49+
buildLowestNumberRec(str, n, res);
50+
51+
return res;
52+
}
53+
54+
// Driver program to test above function
55+
int main()
56+
{ vector<int>v; v.push_back(NULL);
57+
string str = "987654321";
58+
int n = 2;
59+
cout << buildLowestNumber(str, n);
60+
return 0;
61+
}

00.cpp

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/* |\ | | ||\ \ /(_~ |~)|_~|\/||_~|\/||~)|_~|~)
2+
|~\|_|/\||~\ | ,_) |~\|__| ||__| ||_)|__|~\
3+
4+
\ //~\| | |\ |~)|_~ | ||\ ||/~\| ||_~
5+
| \_/\_/ |~\|~\|__ \_/| \||\_X\_/|__
6+
(J U S T L I K E E V E R Y O N E E L S E !)
7+
8+
__ ,..---.._
9+
+''''`--''-..`--..__
10+
.\ _,/:i--._`:-:+._`.``-._
11+
/`.._,,' \ `-.``--:.b....=.
12+
|`..__,,..`. '`.__::i--.-::_
13+
)- .....--i'\.. --+`'''-'
14+
,' .'.._,.-'|._-b\
15+
/,'<' V `oi| \ _.
16+
|/ -|,--.." ,'-. ||\.. _.,;:'_<'
17+
''/ | . ' |\||'\ /-'_/' `.
18+
|,','| , . .-.|:.`. + .,:.. |
19+
._,:'/ /-\ '^' -Y"\ |.| || /,+8d| |
20+
.|/,'| |/':: ':=:' ,'| | | \|| "+)=' |
21+
|+,';' /|_/ \ _/ \b':.\ \'| .|| ,'
22+
,,:-i''_i' | ``-.Y',. ,|`: | \;- | |_,'
23+
__ |'| |i:'._ ,' ,' ,; | |-)-' __--:b__
24+
.P| | |/,'|\ - ._ / / _,Y- ,:/' `. `'".._
25+
,'|| -','' | ._i._ `':| ,..,' ,Y;' \ `- ._
26+
|||||,.. | \ '-.._ _,' / _,b-' `. '-.
27+
||||P..i, .| '....,-' _,'''''-''' ' _,.. `\
28+
+'` <'/ |`-.....---' ._ ,._
29+
| | ,'``,:-''''/,--`.
30+
Y|.b_,,: | || ,;,Y' / |.
31+
,' /'----' .'| .. | | '" .`Y' .,-b_....;;,.
32+
|+|,' | | \., ' ,' `:. _ ,/__` _=: _,'``-
33+
/ +,' | /\_........:.' '"----:::::'Y .'.| |||
34+
|' ' .'/- \ /'|| || | |||
35+
||| /| \L /'|| ||/ | |||
36+
`.| ,'/ .| / ,'||/o;/ |||
37+
`..._,, | |/| ' |||
38+
``-' | |, |||
39+
| ,. | |||
40+
,=--------.... | "" | |||
41+
,/,'. i=..+._ ,.. '..;---:::''- | |
42+
'/| __....b `-''`---....../.,Y'''''j:.,.._ | `._
43+
.' _.Y.-' `.. ii:,'--------' | :-+. .| | b\
44+
| .=_,.---'''''--...:..--:' / _..-----..:= | | '|\
45+
| '-''`'--- ---'_,,,--'' `,.. | | \.
46+
\ . ,' _,--'' :dg: _,/ ||| | \
47+
`::b\` _,-i,-' ,..---' ,|:| | _|
48+
`'--.:-._ ____,,,;.,'' `--._ '''''''' |'|' .' '
49+
``'--....Y''-' `''--..._..____._____...,' | 'o-'
50+
`''''`'''i==_+=_=i__
51+
||'''- ' `.
52+
`-.......-''
53+
*/
54+
#include<bits/stdc++.h>
55+
using namespace std;
56+
57+
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
58+
#define LL long long
59+
#define mod 998244353
60+
#define FOR(i, j, k) for (int i=j ; i<k ; i++)
61+
#define ROF(i, j, k) for (int i=j ; i>=k ; i--)
62+
63+
const long long INF = 1e18;
64+
const long long MAX = 1e5+10;
65+
66+
int main(){
67+
fastio;
68+
int t=1; //cin>>t;
69+
while(t--){
70+
int x,y,b[]={2,3,5}; cin>>x>>y;
71+
72+
int ans = 0;
73+
FOR(i,0,3){
74+
int p=0,q=0;
75+
if(x==y) {cout<<ans; return 0;}
76+
while(x%b[i]==0) {p++;x/=b[i];}
77+
while(y%b[i]==0) {q++;y/=b[i];}
78+
ans+=abs(p-q);
79+
}
80+
if(x==y) {cout<<ans; return 0;}
81+
82+
cout<<-1;
83+
}
84+
}

000.cpp

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/* |\ | | ||\ \ /(_~ |~)|_~|\/||_~|\/||~)|_~|~)
2+
|~\|_|/\||~\ | ,_) |~\|__| ||__| ||_)|__|~\
3+
4+
\ //~\| | |\ |~)|_~ | ||\ ||/~\| ||_~
5+
| \_/\_/ |~\|~\|__ \_/| \||\_X\_/|__
6+
(J U S T L I K E E V E R Y O N E E L S E !)
7+
8+
__ ,..---.._
9+
+''''`--''-..`--..__
10+
.\ _,/:i--._`:-:+._`.``-._
11+
/`.._,,' \ `-.``--:.b....=.
12+
|`..__,,..`. '`.__::i--.-::_
13+
)- .....--i'\.. --+`'''-'
14+
,' .'.._,.-'|._-b\
15+
/,'<' V `oi| \ _.
16+
|/ -|,--.." ,'-. ||\.. _.,;:'_<'
17+
''/ | . ' |\||'\ /-'_/' `.
18+
|,','| , . .-.|:.`. + .,:.. |
19+
._,:'/ /-\ '^' -Y"\ |.| || /,+8d| |
20+
.|/,'| |/':: ':=:' ,'| | | \|| "+)=' |
21+
|+,';' /|_/ \ _/ \b':.\ \'| .|| ,'
22+
,,:-i''_i' | ``-.Y',. ,|`: | \;- | |_,'
23+
__ |'| |i:'._ ,' ,' ,; | |-)-' __--:b__
24+
.P| | |/,'|\ - ._ / / _,Y- ,:/' `. `'".._
25+
,'|| -','' | ._i._ `':| ,..,' ,Y;' \ `- ._
26+
|||||,.. | \ '-.._ _,' / _,b-' `. '-.
27+
||||P..i, .| '....,-' _,'''''-''' ' _,.. `\
28+
+'` <'/ |`-.....---' ._ ,._
29+
| | ,'``,:-''''/,--`.
30+
Y|.b_,,: | || ,;,Y' / |.
31+
,' /'----' .'| .. | | '" .`Y' .,-b_....;;,.
32+
|+|,' | | \., ' ,' `:. _ ,/__` _=: _,'``-
33+
/ +,' | /\_........:.' '"----:::::'Y .'.| |||
34+
|' ' .'/- \ /'|| || | |||
35+
||| /| \L /'|| ||/ | |||
36+
`.| ,'/ .| / ,'||/o;/ |||
37+
`..._,, | |/| ' |||
38+
``-' | |, |||
39+
| ,. | |||
40+
,=--------.... | "" | |||
41+
,/,'. i=..+._ ,.. '..;---:::''- | |
42+
'/| __....b `-''`---....../.,Y'''''j:.,.._ | `._
43+
.' _.Y.-' `.. ii:,'--------' | :-+. .| | b\
44+
| .=_,.---'''''--...:..--:' / _..-----..:= | | '|\
45+
| '-''`'--- ---'_,,,--'' `,.. | | \.
46+
\ . ,' _,--'' :dg: _,/ ||| | \
47+
`::b\` _,-i,-' ,..---' ,|:| | _|
48+
`'--.:-._ ____,,,;.,'' `--._ '''''''' |'|' .' '
49+
``'--....Y''-' `''--..._..____._____...,' | 'o-'
50+
`''''`'''i==_+=_=i__
51+
||'''- ' `.
52+
`-.......-''
53+
*/
54+
#include<bits/stdc++.h>
55+
using namespace std;
56+
57+
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
58+
#define LL long long
59+
#define mod 998244353
60+
#define FOR(i, j, k) for (int i=j ; i<k ; i++)
61+
#define ROF(i, j, k) for (int i=j ; i>=k ; i--)
62+
63+
const long long INF = 1e18;
64+
const long long MAX = 1e5+10;
65+
66+
int main(){
67+
fastio;
68+
int t=1;// cin>>t;
69+
while(t--){
70+
string a,b,c; cin>>a>>b>>c;
71+
int cnt[30]={0};
72+
FOR(i,0,a.size()) cnt[a[i]-'A']++;
73+
FOR(i,0,b.size()) cnt[b[i]-'A']++;
74+
FOR(i,0,c.size()) cnt[c[i]-'A']--;
75+
FOR(i,0,30) if(cnt[i]) {cout<<"NO"; return 0;}
76+
cout<<"YES";
77+
}
78+
}

0 commit comments

Comments
 (0)