Submission #1363099

#TimeUsernameProblemLanguageResultExecution timeMemory
1363099weedywelonGuessing Game (EGOI23_guessinggame)C++20
0 / 100
411 ms808 KiB
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <limits.h>
#include <set>
#include <string>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <deque>
#include <map>
#include <chrono>
#include <random>
#include <bitset>
#include <tuple>
#define SZ(x) int(x.size())
#define FR(i,a,b) for(int i=(a);i<(b);++i)
#define FOR(i,n) FR(i,0,n)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define A first
#define B second
#define mp(a,b) make_pair(a,b)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef unsigned __int128 U128;
typedef __int128 I128;
typedef std::pair<int,int> PII;
typedef std::pair<LL,LL> PLL;
using namespace std;

signed main(){
	int p,n; cin>>p>>n;
	if (p==1){
		int k=n;
		cout<<k<<endl;
		FR(i,1,n){
			int a; cin>>a;
			cout<<i<<endl;
		}
	}
	if (p==2){
		int ord[n+1];
		memset(ord,-1,sizeof(ord));
		
		int g1=-1, g2=-1;
		FR(i,1,n+1){
			int a; cin>>a;
			if (ord[a]!=-1){
				g1=i;
				g2=ord[a];
			}
			else ord[a]=i;
		}
		
		cout<<g1<<" "<<g2;
	}
	return 0;
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...