Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
//#include
#include
#include
#include
#include
using namespace std; typedef long long ll; const ll maxn = 3e5 + 10; const ll logn = 18; const ll INF = 2e15; int main() { ios_base::sync_with_stdio(false); int n, q; cin >> n >> q; vector
v(n); vector
idx(55, -1); for(int i = 0; i < n; i++) { cin >> v[i]; if(idx[v[i]] == -1) { idx[v[i]] = i; } } for(int i = 0; i < q; i++) { int x; cin >> x; cout << idx[x] + 1 << " "; for(int j = 1; j <= 50; j++){ if(idx[j] != -1 and idx[j] < idx[x]) { idx[j]++; } } idx[x] = 0; } return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)