Submission #59354743


Source Code Expand

Copy
// Written in these walls are the stories that I can't explain
// I leave my heart open, but it stays right here empty for days
// She told me in the mornin' she don't feel the same about us in her bones
// It seems to me that when I die, these words will be written on my stone
// And I'll be gone, gone tonight (Oh-oh-oh)
// The ground beneath my feet is open wide (Oh-oh-oh)
// The way that I've been holding on too tight (Oh-oh-oh)
// With nothing in between
// The story of my life, I take her home
// I drive all night to keep her warm
// And time is frozen (The story of, the story of)
// The story of my life, I give her hope
// I spend her love until she's broke inside
// The story of my life (The story of, the story of)
// Written on these walls are the colors that I can't change
// Leave my heart open, but it stays right here in its cage
// I know that in the mornin', I'll see us in the light up on the hill
// Although I am broken, my heart is untamed still
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Written in these walls are the stories that I can't explain
// I leave my heart open, but it stays right here empty for days
// She told me in the mornin' she don't feel the same about us in her bones
// It seems to me that when I die, these words will be written on my stone

// And I'll be gone, gone tonight (Oh-oh-oh)
// The ground beneath my feet is open wide (Oh-oh-oh)
// The way that I've been holding on too tight (Oh-oh-oh)
// With nothing in between

// The story of my life, I take her home
// I drive all night to keep her warm
// And time is frozen (The story of, the story of)
// The story of my life, I give her hope
// I spend her love until she's broke inside
// The story of my life (The story of, the story of)

// Written on these walls are the colors that I can't change
// Leave my heart open, but it stays right here in its cage
// I know that in the mornin', I'll see us in the light up on the hill
// Although I am broken, my heart is untamed still

// And I'll be gone, gone tonight (Oh-oh-oh)
// The fire beneath my feet is burning bright (Oh-oh-oh)
// The way that I've been holding on so tight (Oh-oh-oh)
// With nothing in between

// The story of my life, I take her home
// I drive all night to keep her warm
// And time is frozen (The story of, the story of)
// The story of my life, I give her hope
// I spend her love until she's broke inside
// The story of my life (The story of, the story of)

// And I've been waiting for this time to come around
// But, baby, running after you is like chasin' the clouds

// The story of my life, I take her home
// I drive all night to keep her warm
// And time is frozen

// The story of my life, I give her hope (I give her hope)
// I spend her love until she's broke inside ('Til she's broke inside)
// The story of my life (The story of, the story of)
// [Outro: All & Harry]
// The story of my life
// The story of my life (The story of, the story of)
// The story of my life
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define inf 0x3f3f3f3f
#define pi pair<long long int,long long int>
#define gcd(x,y) __gcd( x, y)
#define ALL(x) x.begin(),x.end()
#define pll pair<long long,long long>
#define debug(x) cerr<<#x<<':'<<x<<endl
#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define lb lower_bound
#define ub upper_bound
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INTMAX 2147483647
#define INT_MAX LONG_LONG_MAX
#define int long long
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset; //upper_bound and lower_bound swap functions in multi
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set_ll;
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset_ll;
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
template<class K,class V> using ht = gp_hash_table<K,V,hash<K>,equal_to<K>,direct_mask_range_hashing<>,linear_probe_fn<>,hash_standard_resize_policy<hash_exponential_size_policy<>,hash_load_check_resize_trigger<>,true>>;
// scem unordered_map and unordered_set, to use umap use ht<ll,ll>, emplace doesnt exist so use .insert(), .reserve() is .resize(),  to declare uset is ht<ll,null_type>, all other operations are same as regular

void solve() {
    ll n; cin >> n; ll arr[n+10];
    for (ll q = 1; q <= n; q++) cin >> arr[q]; 
    unordered_map<ll, ll> mp;
    for (ll q = 1; q <= n; q++) {
        if (mp[arr[q]] == 0) {
            cout << -1 << " ";
        } else {
            cout << mp[arr[q]] << " ";
        }
        mp[arr[q]] = q;
    }
}

signed main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);
  ll tc=1;
  //cin >> tc;
  for (ll q = 0; q < tc; q++) {solve();}
}

Submission Info

Submission Time
Task C - Repeating
User Jxsh28
Language C++ 17 (gcc 12.2)
Score 300
Code Size 4353 Byte
Status AC
Exec Time 49 ms
Memory 14192 KB

Compile Error

Main.cpp:73: warning: "INT_MAX" redefined
   73 | #define INT_MAX LONG_LONG_MAX
      | 
In file included from /usr/include/c++/12/climits:42,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:39,
                 from Main.cpp:49:
/usr/lib/gcc/x86_64-linux-gnu/12/include/limits.h:120: note: this is the location of the previous definition
  120 | #define INT_MAX __INT_MAX__
      | 

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 28
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3480 KB
00_sample_02.txt AC 1 ms 3484 KB
01_random_01.txt AC 23 ms 5044 KB
01_random_02.txt AC 23 ms 5172 KB
01_random_03.txt AC 22 ms 4892 KB
01_random_04.txt AC 22 ms 5036 KB
01_random_05.txt AC 23 ms 5020 KB
01_random_06.txt AC 22 ms 5032 KB
01_random_07.txt AC 25 ms 5048 KB
01_random_08.txt AC 23 ms 5052 KB
01_random_09.txt AC 23 ms 5032 KB
01_random_10.txt AC 25 ms 4960 KB
01_random_11.txt AC 8 ms 3944 KB
01_random_12.txt AC 25 ms 5040 KB
01_random_13.txt AC 17 ms 4644 KB
01_random_14.txt AC 25 ms 4904 KB
01_random_15.txt AC 10 ms 4072 KB
01_random_16.txt AC 32 ms 7132 KB
01_random_17.txt AC 18 ms 5340 KB
01_random_18.txt AC 32 ms 7128 KB
01_random_19.txt AC 3 ms 3844 KB
01_random_20.txt AC 32 ms 7124 KB
02_handmade_01.txt AC 1 ms 3604 KB
02_handmade_02.txt AC 22 ms 5024 KB
02_handmade_03.txt AC 48 ms 14124 KB
02_handmade_04.txt AC 49 ms 14056 KB
02_handmade_05.txt AC 49 ms 14156 KB
02_handmade_06.txt AC 48 ms 14192 KB


2025-03-05 (Wed)
12:33:06 +00:00