結果
| 問題 |
No.3383 1122-like Number (C++)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-22 04:58:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 113 ms / 2,000 ms |
| コード長 | 155 bytes |
| コンパイル時間 | 1,837 ms |
| コンパイル使用メモリ | 194,368 KB |
| 実行使用メモリ | 18,344 KB |
| 最終ジャッジ日時 | 2025-11-22 12:40:39 |
| 合計ジャッジ時間 | 3,722 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
コンパイルメッセージ
main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import"bits/stdc++.h"
| ^~~~~~
main.cpp:2:22: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
2 | int n,i=1,j,l[1<<22];main(){for(std::cin>>n;++i<n;)if(!l[i])for(j=i;j<=n;j+=i)l[j]+=j/i%i>0?:5;printf("%d\n",std::count(l,l-~n,4));}
| ^~~~
main.cpp: In function ‘int main()’:
main.cpp:2:105: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::iterator_traits<int*>::difference_type’ {aka ‘long int’} [-Wformat=]
2 | int n,i=1,j,l[1<<22];main(){for(std::cin>>n;++i<n;)if(!l[i])for(j=i;j<=n;j+=i)l[j]+=j/i%i>0?:5;printf("%d\n",std::count(l,l-~n,4));}
| ~^ ~~~~~~~~~~~~~~~~~~~~
| | |
| int std::iterator_traits<int*>::difference_type {aka long int}
| %ld
ソースコード
#import"bits/stdc++.h"
int n,i=1,j,l[1<<22];main(){for(std::cin>>n;++i<n;)if(!l[i])for(j=i;j<=n;j+=i)l[j]+=j/i%i>0?:5;printf("%d\n",std::count(l,l-~n,4));}