結果
| 問題 |
No.207 世界のなんとか
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-25 14:08:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 513 bytes |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 69,252 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 11:07:01 |
| 合計ジャッジ時間 | 1,220 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / 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;
break;
}
n /= 10;
}while(n <= 0);
if(n <= 0) return false;
}