結果
| 問題 |
No.7 プライムナンバーゲーム
|
| コンテスト | |
| ユーザー |
kr1buki
|
| 提出日時 | 2017-02-01 13:18:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 260 bytes |
| コンパイル時間 | 580 ms |
| コンパイル使用メモリ | 66,132 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 02:18:04 |
| 合計ジャッジ時間 | 1,520 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
#include <vector>
#include<iostream>
using namespace std;
int main(){
int n;
scanf("%d",&n);
vector<int>prime;
prime.push_back(2);
for(int i=2;i<n;i++){
for(int j=3;j<n;j+=2){
if(i%j==0){
prime.push_back(i);
break;
}
}
}
}
kr1buki