CSES Sumof Two Values
// compile: make data
// run: ./data < data.in
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
#include <debug/codeforces.h>
#define debug(x...) _debug_print(#x, x);
#define Debug(x...) _debug_print_format(#x, x);
std::ifstream terminal("/dev/tty");
#define PP cerr<<"\033[1;30mpause...\e[0m",terminal.ignore();
#else
#define debug(x...)
#define Debug(x...)
#define PP
#endif
template<typename...Args> void print_(Args...args){((cout<<args<<" "),...)<<endl;}
#define rep(i,a,b) for(int i=(a);i<(int)(b);++i)
#define sz(v) ((int)(v).size())
#define print(...) print_(__VA_ARGS__);
#define FIND(a, x) ((find(a.begin(),a.end(),(x))!=a.end())?1:0)
#define cmin(x,...) x=min({(x),__VA_ARGS__})
#define cmax(x,...) x=max({(x),__VA_ARGS__})
#define INTMAX (int)(9223372036854775807)
#define INF (int)(1152921504606846976)
#define NaN (int)(0x8b88e1d0595d51d1)
#define double long double
#define int long long
#define uint unsigned long long
#define MAXN 200010


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

    int n, s; cin >> n >> s;
    vector<int> a(n);
    map<int, vector<int>> m;
    rep(i, 0, n) {
        cin >> a[i];
        if (sz(m[a[i]]) < 2) m[a[i]].push_back(i);
    }
    rep(i, 0, n) {
        int r = s - a[i];
        auto v = m[r];
        int cnt = sz(v);
        if (cnt && r != a[i]) {
            cout << i+1 << " " << v[0]+1 << endl;
            return 0;
        }
        else if (cnt > 1 && r == a[i]) {
            if (i == v[0]) cout << i+1 << " " << v[1]+1 << endl;
            else cout << i+1 << " " << v[0]+1 << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE\n";

    return 0;
}

Comments

  1. 4 months ago
    2025-12-06 2:26:54

    Yo, anyone else tried 11ccbet? Been hearing whispers about it. Think I might throw down a few dollars this weekend, see what’s what. Fingers crossed! Check it out 11ccbet.

  2. 3 months ago
    2025-12-19 13:42:01

    Just landed on 1gom.com bong88, looks promising. Fingers crossed for some wins!

  3. 3 months ago
    2025-12-29 6:10:05

    I love the loyalty program on 37winbet. I’d recommend checking them out to see if you can also get perks such as free bets! Check it out: 37winbet

  4. 2 months ago
    2026-1-30 7:00:34

    Heard good things about gamev9. Gonna check it out for some chill gaming sessions. Hope it lives up to the hype! Check out gamev9

  5. 2 months ago
    2026-1-30 7:00:55

    Gobetplayvip, here I come! Looking to see what kind of VIP treatment they’re offering. High hopes for some big wins and cool perks. Go VIP at gobetplayvip

  6. 2 months ago
    2026-1-30 7:01:11

    Time to check out bk664epson! Wonder what they’re offering and if its worth the buzz. Hope I find some great deals. Browse the selection at bk664epson

  7. 1 month ago
    2026-2-05 2:07:50

    18winapp is the real deal; I play on the app and its awesome. Easy to use app, plenty of games and it is safe. You can always get customer service when needed. 18winapp

  8. 1 month ago
    2026-2-05 2:08:05

    99bon is a top resource, they have all the best and newest games. Very easy to navigate the site. I highly recommend them. 99bon

  9. 1 month ago
    2026-2-05 2:08:21

    Looking for a new place to play? I’d say check out cpc5. Their site is easy to find all the cool games on, and quick to load. Customer service is helpful as well! cpc5

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next