#include "dzialka.h" #include "message.h" #include <stdio.h> int main() { if (MyNodeId() > 0) return 0; const int width = GetFieldWidth(); const int height = GetFieldHeight(); long long int sum = 0; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) if (IsUsableCell(y, x)) sum++; printf("%lld\n", sum); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include "dzialka.h" #include "message.h" #include <stdio.h> int main() { if (MyNodeId() > 0) return 0; const int width = GetFieldWidth(); const int height = GetFieldHeight(); long long int sum = 0; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) if (IsUsableCell(y, x)) sum++; printf("%lld\n", sum); } |