답안 #1059896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1059896 2024-08-15T08:56:56 Z kachim2 Lottery (CEOI18_lot) C++17
컴파일 오류
0 ms 0 KB
    int q;
    cin >> q;
    while(q--)
    {
        int k;
        cin >> k;
        for(int i = 0; i < n-l+1; i++)
        {
            int ans = 0;
            for(int j = 0; j < n-l+1; j++)
            {
                if (i==j) continue;
                int diff = 0;
                for(int llll = 0; llll < l; llll++)
                {
                    diff+=a[i+llll]!=a[j+llll];
                }
                if(diff<=k) ans++;
            }
            cout << ans << ' ';
        }
        cout << '\n';

    }

    return 0;
}

Compilation message

lot.cpp:3:5: error: 'cin' does not name a type
    3 |     cin >> q;
      |     ^~~
lot.cpp:4:5: error: expected unqualified-id before 'while'
    4 |     while(q--)
      |     ^~~~~
lot.cpp:27:5: error: expected unqualified-id before 'return'
   27 |     return 0;
      |     ^~~~~~
lot.cpp:28:1: error: expected declaration before '}' token
   28 | }
      | ^