Submission #7022517
Source Code Expand
#include <stdio.h> #define bit(n,m)((n>>m)&1) #define min(p,q)((p)<(q)?(p):(q)) #define MOD 1000000007 #define add(x)(x=(x+t)%MOD) long dp[70][3]; //n桁目まで見て猶予がi int main(){ long N; scanf("%ld",&N); dp[63][0]=1; for(int n=63;n>=1;n--)for(int i=0;i<3;i++){ int t=dp[n][i]; int x=i*2+bit(N,n-1); //x0 y0 add(dp[n-1][min(2,x)]); //x0 y1 if(x>=1)add(dp[n-1][min(2,x-1)]); //x1 y1 if(x>=2)add(dp[n-1][min(2,x-2)]); } printf("%lld",(dp[0][0]+dp[0][1]+dp[0][2])%MOD); }
Submission Info
Submission Time | |
---|---|
Task | D - Xor Sum |
User | kyopro_friends |
Language | C (GCC 5.4.1) |
Score | 600 |
Code Size | 525 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:23:9: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int’ [-Wformat=] printf("%lld",(dp[0][0]+dp[0][1]+dp[0][2])%MOD); ^ ./Main.c:11:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%ld",&N); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 600 / 600 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_max_01.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt, subtask_1_rand_04.txt, subtask_1_rand_05.txt, subtask_1_small_rand_01.txt, subtask_1_small_rand_02.txt, subtask_1_small_rand_03.txt, subtask_1_small_rand_04.txt, subtask_1_small_rand_05.txt, subtask_1_specific_01.txt, subtask_1_specific_02.txt, subtask_1_specific_03.txt, subtask_1_specific_04.txt, subtask_1_specific_05.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 0 ms | 128 KB |
sample_02.txt | AC | 1 ms | 128 KB |
sample_03.txt | AC | 1 ms | 128 KB |
subtask_1_max_01.txt | AC | 1 ms | 128 KB |
subtask_1_rand_01.txt | AC | 1 ms | 128 KB |
subtask_1_rand_02.txt | AC | 1 ms | 128 KB |
subtask_1_rand_03.txt | AC | 1 ms | 128 KB |
subtask_1_rand_04.txt | AC | 1 ms | 128 KB |
subtask_1_rand_05.txt | AC | 0 ms | 128 KB |
subtask_1_small_rand_01.txt | AC | 0 ms | 128 KB |
subtask_1_small_rand_02.txt | AC | 1 ms | 128 KB |
subtask_1_small_rand_03.txt | AC | 0 ms | 128 KB |
subtask_1_small_rand_04.txt | AC | 0 ms | 128 KB |
subtask_1_small_rand_05.txt | AC | 0 ms | 128 KB |
subtask_1_specific_01.txt | AC | 1 ms | 128 KB |
subtask_1_specific_02.txt | AC | 1 ms | 128 KB |
subtask_1_specific_03.txt | AC | 1 ms | 128 KB |
subtask_1_specific_04.txt | AC | 1 ms | 128 KB |
subtask_1_specific_05.txt | AC | 1 ms | 128 KB |