Submission #1341121
Source Code Expand
#include<bits/stdc++.h> using namespace std; bool a[8]; int main(){ int n; scanf("%d",&n); memset(a,false,sizeof(a)); int ans=0; for(int i=0;i<n;i++){ int temp; scanf("%d",&temp); if(temp<400) a[0]=true; else if(temp<800) a[1]=true; else if(temp<1200) a[2]=true; else if(temp<1600) a[3]=true; else if(temp<2000) a[4]=true; else if(temp<2400) a[5]=true; else if(temp<2800) a[6]=true; else if(temp<3200) a[7]=true; else ans++; } int x=0; for(int i=0;i<8;i++) if(a[i]) x++; printf("%d %d\n",x,x+ans); }
Submission Info
Submission Time | |
---|---|
Task | C - Colorful Leaderboard |
User | Qaz |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 781 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:6:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&n); ^ ./Main.cpp:11:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&temp); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | WA | 1 ms | 256 KB |
in2.txt | AC | 1 ms | 256 KB |
in3.txt | AC | 1 ms | 256 KB |
in4.txt | AC | 1 ms | 256 KB |
in5.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |
s3.txt | AC | 1 ms | 256 KB |