結果
| 問題 |
No.3240 Count 8 Included Numbers (Easy)
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2025-09-23 17:03:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 323 bytes |
| コンパイル時間 | 1,415 ms |
| コンパイル使用メモリ | 163,388 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-09-23 17:03:34 |
| 合計ジャッジ時間 | 2,622 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = long long;
int main(){
int n;
cin >> n;
int ans = 0;
rep(i, 1, n + 1) {
string s = to_string(i);
int sz = s.size();
int f = 0;
rep(j, 0, sz) if(s[j] == '8') f++;
if(f) ans++;
}
cout << ans << endl;
}
forest3