summaryrefslogtreecommitdiff
path: root/158A/main.cpp
diff options
context:
space:
mode:
authormjkwiatkowski <mati.rewa@gmail.com>2026-06-01 14:34:18 +0200
committermjkwiatkowski <mati.rewa@gmail.com>2026-06-01 14:34:18 +0200
commit7172d4f401f22192abc1e116a9a88c5078eb082f (patch)
tree65b099c01ddea514a99ad68bd6306fed1a6f8b67 /158A/main.cpp
initial commitHEADmaster
Diffstat (limited to '158A/main.cpp')
-rw-r--r--158A/main.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/158A/main.cpp b/158A/main.cpp
new file mode 100644
index 0000000..036e560
--- /dev/null
+++ b/158A/main.cpp
@@ -0,0 +1,28 @@
+#include <iostream>
+#include <vector>
+
+using namespace std;
+int main(){
+ int a,b;
+ vector<int> v;
+ cin>>a>>b;
+ int c;
+
+ for(int i = 0; i < a; i++){
+ cin>>c;
+ v.push_back(c);
+ }
+
+ int k = v.at(b - 1);
+ int count = 0;
+
+ for(int i = 0; i < v.size(); i++){
+ if(v.at(i) >= k && v.at(i) > 0){
+ count++;
+ }
+ }
+ cout<<count;
+
+
+ return 0;
+}