結果
| 問題 | No.3240 Count 8 Included Numbers (Easy) |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2025-09-23 17:03:31 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 461µs | |
| コード長 | 323 bytes |
| 記録 | |
| コンパイル時間 | 1,003 ms |
| コンパイル使用メモリ | 183,056 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 05:00:59 |
| 合計ジャッジ時間 | 2,324 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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