Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
求易错数据In Reply To:To WAers Posted by:Ruby931031 at 2012-04-02 12:04:03 #include<stdio.h> int main() { long long int a[101], r, r2; int n, m, i, j, s, e; char x; while (~scanf("%d %d", &n, &m)) { for (i = 0; i <= 2 * n; i++) a[i] = 0; s = e = n; r2 = a[n] = (long long int)1 << n; for (j = 0; j < n; j++) { for (i = s; i <= e; i += 2) { getchar(); x = getchar(); if (x == '*') { a[i - 1] += a[i] / 2; a[i + 1] += a[i] / 2; a[i] = 0; } } s--; e++; } for (i = 1; i <= 2 * n; i += 2) { a[i - 1] += a[i] / 2; a[i + 1] += a[i] / 2; a[i] = 0; } r = a[2 * m]; if (r) { while (!(r % 2)) { r /= 2; r2 /= 2; } printf("%lld/%lld\n", r, r2); } else printf("0/1\n"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator