[解題報告][ZeroJudge][d562] 山寨版磁力蜈蚣 七月 9, 2010 程式碼, ZeroJudge 本文总阅读量次 1234567891011121314151617181920212223242526272829/*Problem: d562Language: C++Result: AC (166ms, 720KB) on ZeroJudgeAuthor: m80126colin at 2010-07-09 18:26:02Solution: Straight Forward*/#include <iostream>using namespace std;int main() { bool ox; int n,i,j,k,l,a[100]; for (ox=0;~scanf("%d",&n);ox=1) { if (ox) printf("\n"); for (i=1;i<=n;i++) scanf("%d",&a[i]); for (i=1,j=n,k=n&1;n;n--) { if (((j+1-i)&1) == k) { for (l=i;l<=j;l++) printf("%d ",a[l]); i++; } else { for (l=j;l>=i;l--) printf("%d ",a[l]); j--; } printf("\n"); } }} Newer [解題報告][ZeroJudge][d563] 等值首尾和 Older [解題報告][ZeroJudge][d561] 被秒殺的四捨五入