結果

問題 No.3240 Count 8 Included Numbers (Easy)
ユーザー suakii
提出日時 2025-10-13 16:16:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 3,489 ms
コンパイル使用メモリ 251,436 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-13 16:16:29
合計ジャッジ時間 4,716 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, n) for(int i =0; i < (n); i++)
using ll = long long int;

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//freopen("input.txt", "r", stdin);
    int n; cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        string s = to_string(i);
        if (s.find('8') != string::npos) ans++;
    }

    cout << ans << endl;

	return 0;  
}  
0