Submission #3629740


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
bool a[100000000];int x;
int main()
{
	while(!x)
	{ scanf("%d",&x);
	  for(int i=2;i<x;i++)
	  { if(!a[i]&&!(x%i)){printf("%d\n",i);break;} 
	    if(!a[i])for(int j=1;j*i<=x;j++)a[j*i]=1;}
	}
	return 0;
}

Submission Info

Submission Time
Task B - Working for the World
User luogu_bot5
Language C++ (GCC 5.4.1)
Score 0
Code Size 261 Byte
Status WA
Exec Time 2103 ms
Memory 82176 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  { scanf("%d",&x);
                  ^

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 26
TLE × 1
Set Name Test Cases
All 00-sample, 10-minimum, 11-maximum, 12-little, 13-large, 14-middle, 15-zero, 50-random00, 50-random01, 50-random02, 50-random03, 50-random04, 50-random05, 50-random06, 50-random07, 50-random08, 50-random09, 50-random10, 50-random11, 50-random12, 50-random13, 50-random14, 50-random15, 50-random16, 50-random17, 50-random18, 50-random19
Case Name Status Exec Time Memory
00-sample WA 1 ms 256 KB
10-minimum WA 1 ms 256 KB
11-maximum WA 1 ms 256 KB
12-little WA 1 ms 256 KB
13-large WA 1 ms 256 KB
14-middle WA 1 ms 256 KB
15-zero TLE 2103 ms 256 KB
50-random00 WA 36 ms 45312 KB
50-random01 WA 2 ms 1664 KB
50-random02 WA 1 ms 256 KB
50-random03 WA 1 ms 256 KB
50-random04 WA 27 ms 28928 KB
50-random05 WA 1 ms 256 KB
50-random06 WA 25 ms 14592 KB
50-random07 WA 1 ms 256 KB
50-random08 WA 1 ms 256 KB
50-random09 WA 1 ms 256 KB
50-random10 WA 32 ms 57600 KB
50-random11 WA 1 ms 256 KB
50-random12 WA 1 ms 256 KB
50-random13 WA 1337 ms 69888 KB
50-random14 WA 1 ms 256 KB
50-random15 WA 1 ms 256 KB
50-random16 WA 84 ms 82176 KB
50-random17 WA 43 ms 78080 KB
50-random18 WA 1 ms 256 KB
50-random19 WA 1 ms 256 KB