Submission #3248070
Source Code Expand
#include "stdio.h" int main() { int n, res, i; while(scanf("%d", &n), n) { for(i=2; i*i<=n; ++i) { while(!n%i) { n/=i; res=i; } } if(n!=1) res=n; printf("%d\n",res); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Working for the World |
User | luogu_bot4 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 231 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:5:2: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] while(scanf("%d", &n), n) ^
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
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 | 128 KB |
10-minimum | AC | 0 ms | 128 KB |
11-maximum | WA | 0 ms | 128 KB |
12-little | WA | 1 ms | 128 KB |
13-large | WA | 1 ms | 128 KB |
14-middle | WA | 1 ms | 128 KB |
15-zero | AC | 1 ms | 128 KB |
50-random00 | WA | 1 ms | 128 KB |
50-random01 | WA | 1 ms | 128 KB |
50-random02 | WA | 1 ms | 128 KB |
50-random03 | WA | 1 ms | 128 KB |
50-random04 | WA | 1 ms | 128 KB |
50-random05 | WA | 1 ms | 128 KB |
50-random06 | WA | 0 ms | 128 KB |
50-random07 | WA | 1 ms | 128 KB |
50-random08 | WA | 1 ms | 128 KB |
50-random09 | WA | 1 ms | 128 KB |
50-random10 | WA | 1 ms | 128 KB |
50-random11 | WA | 1 ms | 128 KB |
50-random12 | WA | 1 ms | 128 KB |
50-random13 | WA | 1 ms | 128 KB |
50-random14 | WA | 1 ms | 128 KB |
50-random15 | WA | 1 ms | 128 KB |
50-random16 | WA | 1 ms | 128 KB |
50-random17 | WA | 1 ms | 128 KB |
50-random18 | WA | 1 ms | 128 KB |
50-random19 | WA | 1 ms | 128 KB |