Submission #62511170


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
using ui = unsigned;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define rep(i,l,r) for(int i=(l);i<=(r);++i)
#define per(i,l,r) for(int i=(l);i>=(r);--i)
#define repn(i,n) for(int i=0;i<(n);++i)
#define sizc(x) ((int)(x).size())
#define allc(x) (x).begin(),(x).end()
#define fir first
#define sec second
constexpr int N = 3e5+5;
int n;
int p[N],ip[N],q[N],iq[N];
signed main(){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;

using ui = unsigned;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define rep(i,l,r) for(int i=(l);i<=(r);++i)
#define per(i,l,r) for(int i=(l);i>=(r);--i)
#define repn(i,n) for(int i=0;i<(n);++i)
#define sizc(x) ((int)(x).size())
#define allc(x) (x).begin(),(x).end()
#define fir first
#define sec second

constexpr int N = 3e5+5;

int n;
int p[N],ip[N],q[N],iq[N];

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

    cin>>n;
    rep(i,1,n)cin>>p[i],ip[p[i]]=i;
    rep(i,1,n)cin>>q[i],iq[q[i]]=i;
    rep(i,1,n)cout<<q[p[iq[i]]]<<' ';cout<<'\n';
}

Submission Info

Submission Time
Task C - Bib
User KnownError_
Language C++ 20 (gcc 12.2)
Score 300
Code Size 675 Byte
Status AC
Exec Time 56 ms
Memory 8252 KB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:8:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    8 | #define rep(i,l,r) for(int i=(l);i<=(r);++i)
      |                    ^~~
Main.cpp:28:5: note: in expansion of macro ‘rep’
   28 |     rep(i,1,n)cout<<q[p[iq[i]]]<<' ';cout<<'\n';
      |     ^~~
Main.cpp:28:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
   28 |     rep(i,1,n)cout<<q[p[iq[i]]]<<' ';cout<<'\n';
      |                                      ^~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 13
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All min.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, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
min.txt AC 1 ms 3496 KB
random_01.txt AC 54 ms 8120 KB
random_02.txt AC 2 ms 3556 KB
random_03.txt AC 56 ms 8252 KB
random_04.txt AC 6 ms 4128 KB
random_05.txt AC 56 ms 8096 KB
random_06.txt AC 12 ms 4656 KB
random_07.txt AC 56 ms 8116 KB
random_08.txt AC 49 ms 7744 KB
random_09.txt AC 55 ms 8196 KB
random_10.txt AC 21 ms 5600 KB
sample_01.txt AC 1 ms 3492 KB
sample_02.txt AC 1 ms 3384 KB


2025-03-18 (Tue)
08:11:53 +00:00