Submission #1341860

#TimeUsernameProblemLanguageResultExecution timeMemory
1341860marzuq01Gift Boxes (EGOI25_giftboxes)C++20
8 / 100
139 ms31752 KiB
#include<bits/stdc++.h>
using namespace std;
#define lint long long
#define pb push_back
#define vi vector<int>
#define vll vector<long long>
#define nl '\n'
#define debun(x) cout << #x << ": " << x << "\n";
#define debug(x) cout << #x << ": " << x << " ";

const int mod = 1e9+7;
const int MOD = 998244353;

string yes = "YES";
string no = "NO";

// CODING SETTING :O

void usaco(string name) {
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}
void fastIO() {
	ios::sync_with_stdio(0);
	cin.tie(0);
}

// GENERAL SHORTCUTS AND FUNCTIONS :D
template<typename T>
void vprint(const vector<T> &arr) {
	for (auto i : arr) cout << i << " ";
	cout << nl;
}
template <typename T, typename R>
void vpprint(const vector<pair<T,R>> &arr) {
    for (auto i: arr) cout << "{" << i.first << "," << i.second << "} ";
    cout << "\n";
}

template<typename T>
T expo(T a, T b,T m = mod) {
	if (b == 0) return 1;
	else if (b == 1) return a;
	if (b % 2 == 0) return expo(a*a % m,b/2) % m;
	else return (a*expo(a*a % m, b/2) % m) % m;
}

template<typename T>
T gcd(T a, T b) {
	if (a == 0) return b;
	else return gcd(b%a,a);
}
// ============< DONT TOUCH CODES ABOVE >=============
int NNN = 2000000;
int isprime[2000000];
vector<int> prime;
void thanos() {
    for (int i = 0;i < NNN;i++) isprime[i] = 1;
    isprime[0] = isprime[1] = 0;
    for (int j = 4; j < NNN;j+=2) isprime[j] = 0;
    for (int i = 3;i*i < NNN;i+=2) {
        for (int j = i*i; j < NNN;j += i) isprime[j] = 0;
    }
    prime.pb(2);
    for (int i = 3;i < NNN;i+=2) if(isprime[i]) prime.pb(i);
}

// ============< DONT also TOUCH CODES ABOVE >=============
void init() {
    //thanos();
}

void solve() {
    lint t,n; cin >> t >> n;
    vector<lint> arr(n);
    for (lint i = 0;i < n;i++) cin >> arr[i];
    vector<vector<int>> pos(t);
    for (int i = 0;i < n;i++) {
        pos[arr[i]].pb(i);
    }
    for (auto i: pos) if (i.size() == 2) {
        cout << i[0] << " " << i[0] << nl;
        return;
    }
}

int main()
{
    //usaco("haybales");
    fastIO();
    long long int t=1;
    //cin >> t;
    init();
    for (int aura = 0; aura < t; aura++) {
        solve();
    }
    return 0;
}


Compilation message (stderr)

Main.cpp: In function 'void usaco(std::string)':
Main.cpp:20:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |         freopen((name+".in").c_str(),"r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:21:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |         freopen((name+".out").c_str(),"w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...