結果
問題 |
No.207 世界のなんとか
|
ユーザー |
![]() |
提出日時 | 2019-02-09 20:54:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 649 bytes |
コンパイル時間 | 1,657 ms |
コンパイル使用メモリ | 158,936 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 19:17:32 |
合計ジャッジ時間 | 2,098 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { // 1. 入力情報取得. LL A, B; cin >> A >> B; // 2. 3の倍数 および 3の付く数を出力. for(LL i = 0LL; i <= B - A; i++){ LL ans = A + i; bool ok = false; // 3の倍数のとき. if(ans % 3 == 0) ok = true; // 3の付く数のとき. string s = to_string(ans); if(s.find({'3'}) != string::npos) ok = true; // ok == true なら, 出力. if(ok) cout << ans << endl; } // 3. 後処理. return 0; }