結果
問題 |
No.207 世界のなんとか
|
ユーザー |
|
提出日時 | 2023-09-25 14:12:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 539 ms |
コンパイル使用メモリ | 70,660 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 11:10:37 |
合計ジャッジ時間 | 1,217 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 15 |
コンパイルメッセージ
main.cpp: In function 'bool is3(int)': main.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type] 35 | } | ^
ソースコード
#include <iostream> #include <vector> using namespace std; bool is3(int n); int main(void){ //input int min,max; cin >> min >> max; //calc vector<int> three; bool isThree; for(int i=min;i<=max;i++){ isThree = is3(i); if(isThree) three.push_back(i); } //output for (auto i = three.begin(); i != three.end(); ++i) { cout << *i << endl; } } bool is3(int n){ if(n % 3 == 0) return true; do{ if(n % 10 == 3){ return true; exit(0); } n /= 10; }while(n <= 0); if(n <= 0) return false; }