Skip to content

Commit a0188fb

Browse files
committed
kuet contest's file added
1 parent 3157389 commit a0188fb

File tree

7 files changed

+290
-0
lines changed

7 files changed

+290
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "windows-gcc-x86",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"compilerPath": "C:/MinGW/bin/gcc.exe",
9+
"cStandard": "${default}",
10+
"cppStandard": "${default}",
11+
"intelliSenseMode": "windows-gcc-x86",
12+
"compilerArgs": [
13+
""
14+
]
15+
}
16+
],
17+
"version": 4
18+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "C/C++ Runner: Debug Session",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"args": [],
9+
"stopAtEntry": false,
10+
"externalConsole": true,
11+
"cwd": "d:/codeforces-atcoder-submissions/others/Replay of Ostad Presents Intra KUET Programming Contest 2023",
12+
"program": "d:/codeforces-atcoder-submissions/others/Replay of Ostad Presents Intra KUET Programming Contest 2023/build/Debug/outDebug",
13+
"MIMode": "gdb",
14+
"miDebuggerPath": "gdb",
15+
"setupCommands": [
16+
{
17+
"description": "Enable pretty-printing for gdb",
18+
"text": "-enable-pretty-printing",
19+
"ignoreFailures": true
20+
}
21+
]
22+
}
23+
]
24+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"C_Cpp_Runner.cCompilerPath": "gcc",
3+
"C_Cpp_Runner.cppCompilerPath": "g++",
4+
"C_Cpp_Runner.debuggerPath": "gdb",
5+
"C_Cpp_Runner.cStandard": "",
6+
"C_Cpp_Runner.cppStandard": "",
7+
"C_Cpp_Runner.msvcBatchPath": "",
8+
"C_Cpp_Runner.useMsvc": false,
9+
"C_Cpp_Runner.warnings": [
10+
"-Wall",
11+
"-Wextra",
12+
"-Wpedantic",
13+
"-Wshadow",
14+
"-Wformat=2",
15+
"-Wcast-align",
16+
"-Wconversion",
17+
"-Wsign-conversion",
18+
"-Wnull-dereference"
19+
],
20+
"C_Cpp_Runner.msvcWarnings": [
21+
"/W4",
22+
"/permissive-",
23+
"/w14242",
24+
"/w14287",
25+
"/w14296",
26+
"/w14311",
27+
"/w14826",
28+
"/w44062",
29+
"/w44242",
30+
"/w14905",
31+
"/w14906",
32+
"/w14263",
33+
"/w44265",
34+
"/w14928"
35+
],
36+
"C_Cpp_Runner.enableWarnings": true,
37+
"C_Cpp_Runner.warningsAsError": false,
38+
"C_Cpp_Runner.compilerArgs": [],
39+
"C_Cpp_Runner.linkerArgs": [],
40+
"C_Cpp_Runner.includePaths": [],
41+
"C_Cpp_Runner.includeSearch": [
42+
"*",
43+
"**/*"
44+
],
45+
"C_Cpp_Runner.excludeSearch": [
46+
"**/build",
47+
"**/build/**",
48+
"**/.*",
49+
"**/.*/**",
50+
"**/.vscode",
51+
"**/.vscode/**"
52+
],
53+
"C_Cpp_Runner.useAddressSanitizer": false,
54+
"C_Cpp_Runner.useUndefinedSanitizer": false,
55+
"C_Cpp_Runner.useLeakSanitizer": false,
56+
"C_Cpp_Runner.showCompilationTime": false,
57+
"C_Cpp_Runner.useLinkTimeOptimization": false,
58+
"C_Cpp_Runner.msvcSecureNoWarnings": false
59+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
author : MishkatIT
3+
created : Tuesday 2023-10-10-20.54.15
4+
*/
5+
#include <bits/stdc++.h>
6+
#include <ext/pb_ds/assoc_container.hpp>
7+
#include <ext/pb_ds/tree_policy.hpp>
8+
9+
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
10+
#define debug(_) cout << #_ << " is " << _ << '\n';
11+
using namespace std;
12+
using namespace __gnu_pbds;
13+
using ll = long long;
14+
using ld = long double;
15+
const ll mod = 1e9 + 7;
16+
const ll N = 1e5 + 10;
17+
const ll inf = 1e9;
18+
const ll linf = 1e18;
19+
20+
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
21+
22+
int main()
23+
{
24+
fio;
25+
int n, q;
26+
cin >> n >> q;
27+
ordered_set s;
28+
vector<int> freq(11);
29+
auto add = [&] (int x) {
30+
while (x) {
31+
freq[x % 10]++;
32+
x /= 10;
33+
}
34+
};
35+
auto rem = [&] (int x) {
36+
while (x) {
37+
freq[x % 10]--;
38+
x /= 10;
39+
}
40+
};
41+
for (int i = 0; i < n; i++) {
42+
int x;
43+
cin >> x;
44+
s.insert(x);
45+
add(x);
46+
}
47+
while (q--) {
48+
char c;
49+
int x;
50+
cin >> c >> x;
51+
if (c == '+') {
52+
if (s.find(x) == s.end()) {
53+
s.insert(x);
54+
add(x);
55+
} else {
56+
s.erase(x);
57+
rem(x);
58+
}
59+
} else if (c == '-') {
60+
if (s.size() >= x) {
61+
int val = *s.find_by_order(s.size() - x);
62+
rem(val);
63+
s.erase(val);
64+
}
65+
} else {
66+
if (s.find(x) != s.end()) {
67+
int sum = 0;
68+
while (x) {
69+
sum += (freq[x % 10]);
70+
x /= 10;
71+
}
72+
cout << sum << '\n';
73+
} else {
74+
cout << -1 << '\n';
75+
}
76+
}
77+
}
78+
79+
return 0;
80+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
author : MishkatIT
3+
created : Tuesday 2023-10-10-19.00.07
4+
*/
5+
#include<bits/stdc++.h>
6+
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
7+
#define debug(_) cout << #_ << " is " << _ << '\n';
8+
using namespace std;
9+
using ll = long long;
10+
using ld = long double;
11+
const ll mod = 1e9 + 7;
12+
const ll N = 1e5 + 10;
13+
const ll inf = 1e9;
14+
const ll linf = 1e18;
15+
16+
int main()
17+
{
18+
fio;
19+
cout << "KUET WOOD";
20+
return 0;
21+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
author : MishkatIT
3+
created : Tuesday 2023-10-10-19.55.12
4+
*/
5+
#include<bits/stdc++.h>
6+
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
7+
#define debug(_) cout << #_ << " is " << _ << '\n';
8+
using namespace std;
9+
using ll = long long;
10+
using ld = long double;
11+
const ll mod = 1e9 + 7;
12+
const ll N = 1e5 + 10;
13+
const ll inf = 1e9;
14+
const ll linf = 1e18;
15+
16+
int main()
17+
{
18+
fio;
19+
ld x, y, z, n;
20+
cin >> x >> y >> z >> n;
21+
ld att = ceil(x * y * 6.0 / 10.0);
22+
ld rem = (x - z) * y;
23+
if(att - n - rem > 0) {
24+
cout << "No" << '\n';
25+
} else {
26+
cout << "Yes" << '\n';
27+
ld todo = att - n;
28+
vector<int> v(x - z);
29+
for (int i = 0; i < (x - z); i++) {
30+
v[i] = max((ld)0, min(y, todo));
31+
todo -= y;
32+
}
33+
sort(v.begin(), v.end());
34+
for (int i = 0; i < v.size(); i++) {
35+
cout << v[i] << " \n"[i == v.size() - 1];
36+
}
37+
}
38+
return 0;
39+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
author : MishkatIT
3+
created : Tuesday 2023-10-10-22.35.45
4+
*/
5+
#include<bits/stdc++.h>
6+
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
7+
#define debug(_) cout << #_ << " is " << _ << '\n';
8+
using namespace std;
9+
using ll = long long;
10+
using ld = long double;
11+
const ll mod = 1e9 + 7;
12+
const ll N = 1e5 + 10;
13+
const ll inf = 1e9;
14+
const ll linf = 1e18;
15+
16+
int main()
17+
{
18+
fio;
19+
int t;
20+
cin >> t;
21+
while(t--) {
22+
int n, mx, a, c;
23+
cin >> n >> mx >> a >> c;
24+
25+
vector<int> v(n);
26+
for (auto& i : v) {
27+
cin >> i;
28+
}
29+
int ans = 0;
30+
int dec = c, inc = 0;
31+
for (int i = 0; i < n; i++) {
32+
33+
if(v[i] <= mx) {
34+
dec++;
35+
if(dec >= c) inc = 0;
36+
if(inc < a) inc = 0;
37+
} else {
38+
dec = 0;
39+
inc++;
40+
}
41+
if(inc >= a) {
42+
ans++;
43+
}
44+
45+
}
46+
cout << ans << '\n';
47+
}
48+
return 0;
49+
}

0 commit comments

Comments
 (0)