Submission #3019135
Source Code Expand
#include<cstdio> int fuc(int y) { if((y%4==0&&y%100!=0)||(y%4==0&&y%400==0))return 1; return 0; } int main() { int a,b; long sum=0; scanf("%d%d",&a,&b); for(int i=a;i<=b;i++) { if(fuc(i)) { a=i+4; sum++; break; } } for(int i=a;i<=b;i+=4) { if(fuc(i)) sum++; } printf("%d",sum); }
Submission Info
Submission Time | |
---|---|
Task | C - 2月29日 |
User | luogu_bot5 |
Language | C++ (GCC 5.4.1) |
Score | 100 |
Code Size | 335 Byte |
Status | AC |
Exec Time | 936 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:26:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] printf("%d",sum); ^ ./Main.cpp:12:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&a,&b); ^
Judge Result
Set Name | sub | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 25 / 25 | 75 / 75 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
sub | test_01A.txt, test_02A.txt, test_03A.txt, test_04A.txt, test_05A.txt, test_07A.txt, test_09A.txt, test_11A.txt, test_13A.txt, test_15A.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, test_01A.txt, test_02A.txt, test_03A.txt, test_04A.txt, test_05A.txt, test_06.txt, test_07A.txt, test_08.txt, test_09A.txt, test_10.txt, test_11A.txt, test_12.txt, test_13A.txt, test_14.txt, test_15A.txt, test_16.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 0 ms | 128 KB |
sample_02.txt | AC | 0 ms | 128 KB |
sample_03.txt | AC | 936 ms | 128 KB |
test_01A.txt | AC | 0 ms | 128 KB |
test_02A.txt | AC | 0 ms | 128 KB |
test_03A.txt | AC | 0 ms | 128 KB |
test_04A.txt | AC | 0 ms | 128 KB |
test_05A.txt | AC | 0 ms | 128 KB |
test_06.txt | AC | 935 ms | 128 KB |
test_07A.txt | AC | 0 ms | 128 KB |
test_08.txt | AC | 103 ms | 128 KB |
test_09A.txt | AC | 1 ms | 128 KB |
test_10.txt | AC | 144 ms | 128 KB |
test_11A.txt | AC | 0 ms | 128 KB |
test_12.txt | AC | 72 ms | 128 KB |
test_13A.txt | AC | 0 ms | 128 KB |
test_14.txt | AC | 29 ms | 128 KB |
test_15A.txt | AC | 0 ms | 128 KB |
test_16.txt | AC | 86 ms | 128 KB |