結果
問題 |
No.207 世界のなんとか
|
ユーザー |
|
提出日時 | 2025-02-05 09:51:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 839 ms |
コンパイル使用メモリ | 61,184 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-02-05 09:51:50 |
合計ジャッジ時間 | 2,502 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:17:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%d%d",&a,&b); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<iostream> #include<cassert> #define rep(i,n) for(i=0;i<(int)(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; int a,b; bool judge(string str){ int i; rep(i,str.length())if(str[i]=='3')return true; return false; } int main(){ scanf("%d%d",&a,&b); for(;a<=b;a++){ if(a%3==0||judge(to_string(a)))printf("%d\n",a); } return 0; }