Submission #51177785
Source Code Expand
// LUOGU_RID: 150538535
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll MOD=998244353;
// head
const int N=1005;
int a[N],b[N];
signed main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
for(int i=0;i<n;i++) cin>>b[i];
int cnt=0,cnt1=0;
for(int i=0;i<n;i++) if(a[i]==b[i]) cnt++;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i!=j&&a[i]==b[j]) cnt1++;
}
}
cout<<cnt<<endl<<cnt1<<endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Hit and Blow |
| User | gangbengr |
| Language | C++ 17 (gcc 12.2) |
| Score | 200 |
| Code Size | 751 Byte |
| Status | AC |
| Exec Time | 2 ms |
| Memory | 3664 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_same_00.txt, 03_shuffle_00.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3532 KiB |
| 00_sample_01.txt | AC | 1 ms | 3456 KiB |
| 00_sample_02.txt | AC | 1 ms | 3580 KiB |
| 01_random_00.txt | AC | 1 ms | 3432 KiB |
| 01_random_01.txt | AC | 1 ms | 3544 KiB |
| 01_random_02.txt | AC | 1 ms | 3664 KiB |
| 01_random_03.txt | AC | 2 ms | 3468 KiB |
| 01_random_04.txt | AC | 1 ms | 3532 KiB |
| 01_random_05.txt | AC | 1 ms | 3524 KiB |
| 02_same_00.txt | AC | 1 ms | 3528 KiB |
| 03_shuffle_00.txt | AC | 2 ms | 3524 KiB |