Submission #188393
Source Code Expand
#include<stdio.h> #include<string.h> #include<math.h> #include<ctype.h> int ok=0; // 陦後¢縺滓焚 int check(int x, int y, int n, int d, int tx, int ty) { if(x == tx && y == tx){ ok++; } if(n==0){ return; } check(x + d, y, n-1,d,tx,ty); check(x - d, y, n-1,d,tx,ty); check(x , y + d, n-1,d,tx,ty); check(x , y - d, n-1,d,tx,ty); } int main(void) { int n = 11; int d = 8562174; int x = 25686522; int y = 17124348; // //int n = 2; //int d = 100; //int x = 100; //int y = 100; // //int n = 5; //int d = 1; //int x = 4; //int y = 1; scanf("%d%d", &n, &d); scanf("%d%d", &x, &y); check(0,0,n,d,x,y); double all = pow(4,n); //printf("%d¥n", ok); //printf("%lf¥n", all); printf("%f¥n", ok/all); return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 大ジャンプ |
User | bobuhiro11 |
Language | C++ (G++ 4.6.4) |
Score | 0 |
Code Size | 1042 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int check(int, int, int, int, int, int)’: ./Main.cpp:14:17: error: return-statement with no value, in function returning ‘int’ [-fpermissive] ./Main.cpp: In function ‘int main()’: ./Main.cpp:38:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] ./Main.cpp:39:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]