結果
問題 | No.207 世界のなんとか |
ユーザー |
![]() |
提出日時 | 2015-05-15 22:21:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 1,488 ms |
コンパイル使用メモリ | 159,188 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 09:18:52 |
合計ジャッジ時間 | 2,061 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (int (i) = 0; (i) < (int)(n); (i)++) const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; bool ok(ll a) { if (a % 3 == 0) return true; while (a) { int tmp = a%10; if (tmp == 3) return true; a /= 10; } return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll A, B; cin >> A >> B; for (ll i = A; i <= B; i++) { if (ok(i)) { cout << i << endl; } } return 0; }