Submission #1093571
Source Code Expand
#include <stdio.h> #include <stdlib.h> #include <string.h> #define INF (int)1e9+7 int main() { int n, i, j, min, p, sum, rsum=0; scanf("%d", &n); int a[100000]; for(i=0; i<n; i++){ scanf("%d", a+i); } for(i=0; i<n; i++){ sum=0; min=INF; for(j=0; j<n; j++){ if(a[j] < min && a[j] != 0){ min = a[j]; p = j; } } for(j=0; j<n; j++){ a[j] -= min; if(a[j] == 0) sum++; } if(rsum+1 != sum || sum== n){ puts("NO"); return 0; } } puts("YES"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Boxes |
User | casgePZL |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 587 Byte |
Status | WA |
Exec Time | 2102 ms |
Memory | 512 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:9:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.c:12:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", a+i); ^
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in2.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | TLE | 2102 ms | 512 KB |
in10.txt | WA | 145 ms | 256 KB |
in11.txt | TLE | 2102 ms | 512 KB |
in12.txt | TLE | 2102 ms | 512 KB |
in13.txt | TLE | 2102 ms | 512 KB |
in14.txt | WA | 1 ms | 128 KB |
in15.txt | WA | 1 ms | 128 KB |
in16.txt | AC | 1 ms | 128 KB |
in17.txt | AC | 1 ms | 128 KB |
in18.txt | AC | 1 ms | 128 KB |
in19.txt | AC | 1 ms | 128 KB |
in2.txt | TLE | 2102 ms | 512 KB |
in20.txt | AC | 1 ms | 128 KB |
in21.txt | TLE | 2102 ms | 512 KB |
in22.txt | TLE | 2102 ms | 512 KB |
in23.txt | TLE | 2102 ms | 512 KB |
in24.txt | WA | 35 ms | 128 KB |
in25.txt | WA | 135 ms | 256 KB |
in26.txt | TLE | 2102 ms | 512 KB |
in27.txt | TLE | 2102 ms | 512 KB |
in3.txt | WA | 14 ms | 512 KB |
in4.txt | TLE | 2102 ms | 512 KB |
in5.txt | TLE | 2102 ms | 512 KB |
in6.txt | TLE | 2102 ms | 512 KB |
in7.txt | TLE | 2102 ms | 512 KB |
in8.txt | WA | 135 ms | 256 KB |
in9.txt | WA | 135 ms | 256 KB |
sample1.txt | AC | 1 ms | 128 KB |
sample2.txt | AC | 1 ms | 128 KB |
sample3.txt | AC | 1 ms | 128 KB |