提出 #59522500


ソースコード 拡げる

#include<bits/stdc++.h>
#include"atcoder/all"
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef vector<ll> vi;
constexpr ll mod = 1000000007;
typedef modint1000000007 mi;

ll a[46],b[46],c[46];

int main(){
    int n;cin>>n;
    rep(i,n){
        int ca;cin>>ca;a[ca%46]++;
    }
    rep(i,n){
        int ca;cin>>ca;b[ca%46]++;
    }
    rep(i,n){
        int ca;cin>>ca;c[ca%46]++;
    }
    ll ans=0;

    rep(i,46){
        rep(j,46){
            ans+=a[i]*b[j]*c[(92-i-j)%46];
        }
    }
    cout<<ans<<endl;
}

提出情報

提出日時
問題 046 - I Love 46(★3)
ユーザ Rho17
言語 C++ 20 (gcc 12.2)
得点 3
コード長 651 Byte
結果 AC
実行時間 80 ms
メモリ 3716 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 3 / 3
結果
AC × 3
AC × 20
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 80 ms 3504 KiB
hand_02.txt AC 26 ms 3536 KiB
hand_03.txt AC 57 ms 3580 KiB
hand_04.txt AC 1 ms 3568 KiB
random_01.txt AC 41 ms 3576 KiB
random_02.txt AC 45 ms 3452 KiB
random_03.txt AC 65 ms 3484 KiB
random_04.txt AC 58 ms 3580 KiB
random_05.txt AC 67 ms 3524 KiB
random_06.txt AC 5 ms 3716 KiB
random_07.txt AC 62 ms 3520 KiB
random_08.txt AC 67 ms 3580 KiB
random_09.txt AC 64 ms 3488 KiB
random_10.txt AC 62 ms 3504 KiB
random_11.txt AC 74 ms 3480 KiB
random_12.txt AC 75 ms 3536 KiB
random_13.txt AC 73 ms 3676 KiB
sample_01.txt AC 1 ms 3532 KiB
sample_02.txt AC 1 ms 3580 KiB
sample_03.txt AC 1 ms 3684 KiB