rt,只得50pts,本地运行完全正确,请各位神犇大佬看看awa
话说不开放数据下载的么
#include <iostream>
using namespace std;
int a[] = { 0,1,2,3,4,5,6 };//1上,2前,3右,4左,5后,6下,忽略0
int t;
void North()
{
t = a[1];
a[1] = a[2];
a[2] = a[6];
a[6] = a[5];
a[5] = t;
}
void East()
{
t = a[1];
a[1] = a[4];
a[4] = a[6];
a[6] = a[3];
a[3] = t;
}
void West()
{
t = a[1];
a[1] = a[3];
a[3] = a[6];
a[6] = a[4];
a[4] = t;
}
void South()
{
t = a[1];
a[1] = a[5];
a[5] = a[6];
a[6] = a[2];
a[2] = t;
}
void Right()
{
t = a[2];
a[2] = a[3];
a[3] = a[5];
a[5] = a[4];
a[4] = t;
}
void Left()
{
t = a[2];
a[2] = a[4];
a[4] = a[5];
a[5] = a[3];
a[3] = t;
}
inline int midcircle() {
return a[1] + a[6] + a[3] + a[4];
}
int main()
{
int ans = 0;
int r, c;
cin >> r >> c;
bool flag = false;
if (c % 4) { flag = true; ans = 1; }
int x = 1;
int t = 1;
for (; x <= r; x++) {
if (t & 1) {
int round = c / 4;
ans += midcircle() * round;
if (flag) {
round = c % 4;
for (int i = 1; i < round; i++) East(), ans += a[1];
}
}
else {
int round = c / 4;
ans += midcircle() * round;
if (flag) {
round = c % 4;
for (int i = 1; i < round; i++)West(), ans += a[1];
}
}
South();
if (x != r && flag) ans += a[1];
t++;
}
cout << ans << endl;
return 0;
}