結果
問題 |
No.315 世界のなんとか3.5
|
ユーザー |
![]() |
提出日時 | 2015-09-20 00:59:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 629 bytes |
コンパイル時間 | 538 ms |
コンパイル使用メモリ | 73,632 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 08:15:40 |
合計ジャッジ時間 | 3,668 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 20 RE * 2 |
ソースコード
//TLE //全探索 //小さなケースでの確認用 #include <iostream> #include <vector> #include <cstdio> #include <sstream> #include <map> #include <string> #include <algorithm> #include <queue> #include <cmath> #include <set> using namespace std; #define MOD 1000000007 int main(){ long long a,b; cin >> a >> b; int P; cin >> P; long long ans = 0; char baff[100]; for(long long i=a; i<=b; i++){ bool ok = false; if(i%3==0) ok = true; sprintf(baff, "%lld", i); string s(baff); if(s.find('3') != string::npos) ok = true; if(i%P == 0) ok = false; if(ok) ans++; } cout << ans << endl; return 0; }