QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#713220#2850. 蛋糕HHAZ#WA 6ms3664kbC++202.1kb2024-11-05 18:40:202024-11-05 18:40:22

Judging History

你现在查看的是最新测评结果

  • [2024-11-05 18:40:22]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3664kb
  • [2024-11-05 18:40:20]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int>pii;
typedef pair<ll,ll>pll;
typedef pair<ld,ld>pdd;
typedef pair<ll, pair<ll, ll> > plpair;
typedef vector<int> vi;
typedef vector<ll> vl;
#define endl '\n'
#define rep(i, a, b) for (ll i = (a); i <= (b); ++i)
#define per(i, a, b) for(ll i = (a); i >= (b); --i)
#define debug(x) cout<<#x<<": "<<x<<endl
#define lowbit(id) id & (-id)
#define fi first
#define sec second
#define lc id<<1
#define rc id<<1|1
#define sz(x) (int)(x).size()
#define all(t) (t).begin(), (t).end()
#define meh {cout<<"NO"<<endl;return;}
#define yay {cout<<"YES"<<endl;return;}
#define vin(v) for(auto&x:v)cin>>x;
#define print(v) for (auto x: v)cout<<x<<' ';cout<<endl;
#define sqrt(x) sqrtl(x)
mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
const ll N = 10;
const ll mod = 2148473648;

void solve() {
    ll a[5];
    cin >> a[1] >> a[2] >> a[3] >> a[4];
    ll s0 = 1;
    rep(i, 1, 4) {
        s0 *= max(0ll, (a[i] - 2));
        s0 %= mod;
    }
    ll s1 = 0;
    rep(i, 1, 4) {
        rep(j, i + 1, 4) {
            rep(k, j + 1, 4) {
                s1 += max(0ll, a[i] - 2) * max(0ll, a[j] - 2) % mod * max(0ll, a[k] - 2) % mod * 2 % mod;
                s1 %= mod;
            }
        }
    }
    ll s2 = 0;
    rep(i, 1, 4) {
        rep(j, i + 1, 4) {
            s2 += max(0ll, a[i] - 2) * max(0ll, a[j] - 2) % mod;
            s2 %= mod;
        }
    }
    s2 *= 4;
    s2 %= mod;
    ll s3 = 0;
    rep(i, 1, 4) {
        s3 += max(0ll, a[i] - 2) * 8 % mod;
        s3 %= mod;
    }
    ll s4 = 16;
    rep(i, 1, 4) {
        if(a[i] == 1) {
            s4 /= 2;
        }
    }
    if(s4 == 1) s4 = 0;
    cout << s0 << ' ' << s1 << ' ' << s2 << ' ' << s3 << ' ' << s4 << ' ' << 0 << ' ' << 0 << ' ' << 0 << ' ' << 0 << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
//     freopen("test.in","r",stdin);
//     freopen("test.out","w",stdout);
	int T=1;
	cin>>T;
	while(T--)
	{
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 6ms
memory: 3664kb

input:

9999
18429 66560 1 13694
48994 1 16287 10018
26028 52162 14916 1
30285 52396 33384 55269
65461 96967 74820 73364
55054 70162 1 1
97285 88897 39444 35439
61069 20048 35664 1
21838 22945 6244 79240
46316 82624 33318 31522
90387 93765 7568 97379
22273 74037 1255 91257
67961 28295 1 36263
20958 87638 59...

output:

0 557394608 966420952 789416 8 0 0 0 0
0 1878117216 1509649312 602344 8 0 0 0 0
0 1857650272 1500434064 744800 8 0 0 0 0
1239780156 506705424 73742516 1370608 16 0 0 0 0
1867092428 2145345144 1816812716 2484832 16 0 0 0 0
0 0 410477744 1001696 4 0 0 0 0
1222501394 1134629934 1413163092 2088456 16 0 ...

result:

wrong answer 1st lines differ - expected: '0 0 278697304 483210476 394708 8 0 0 0', found: '0 557394608 966420952 789416 8 0 0 0 0'