답안 #723496

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723496 2023-04-14T01:16:55 Z vjudge1 Telefoni (COCI17_telefoni) C++17
8 / 80
43 ms 2428 KB
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define S second
#define F first
#define ll long long
#define PB push_back
#define PF push_front

using namespace std;
signed main(){
    
   ll n,d;
   ll cont = 0;
   cin >> n >> d;
   vector<int>V;
   
   for(ll i = 0;i < n;i++){
     ll x;
     cin >> x;
     V.PB(x);
   }
   ll pos = 0;
    for(pos = 0; pos < n ;pos){
     
       if(V[pos]==1){
        pos++;
        continue;
       }
        else{
        pos += d;
        cont++;
       }
       
    }
   cout << cont;
    return 0;
}

Compilation message

telefoni.cpp: In function 'int main()':
telefoni.cpp:23:27: warning: for increment expression has no effect [-Wunused-value]
   23 |     for(pos = 0; pos < n ;pos){
      |                           ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 256 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Incorrect 40 ms 2360 KB Output isn't correct
9 Incorrect 43 ms 2364 KB Output isn't correct
10 Incorrect 39 ms 2428 KB Output isn't correct