結果
| 問題 |
No.207 世界のなんとか
|
| コンテスト | |
| ユーザー |
projectappbird
|
| 提出日時 | 2019-07-25 15:03:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 498 bytes |
| コンパイル時間 | 885 ms |
| コンパイル使用メモリ | 78,692 KB |
| 最終ジャッジ日時 | 2025-01-07 07:29:22 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
inline bool check3(unsigned long* num,const unsigned int start,const unsigned int end = 0){
for (unsigned int d = start; d <= ((end) ? end : floor(log10(*num)) + 1); d++){
if ( 3 == floor(*num/pow(10,d-1)) - floor(*num/pow(10,d))*10) return true;
}
return false;
}
int main(){
unsigned long a;
unsigned long b;
cin >> a >> b;
for (;a<=b;a++){
if (!(a%3) || check3(&a,1)) cout << a << endl;
}
}
projectappbird