Блог пользователя yash_daga

Автор yash_daga, история, 2 года назад, По-английски

We invite you to participate in CodeChef’s Starters 155, this Wednesday, 9th October, rated upto 5 stars (i.e. for users with rating < 2200)

Time: 8:00 PM — 10:00 PM IST

Joining us on the problem setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest. The video editorials of the problems will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here. Hope to see you participating.

Good Luck!

  • Проголосовать: нравится
  • +58
  • Проголосовать: не нравится

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The contest starts in around ~15 minutes.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What wrong with this Replace With First's logic ?

#include <bits/stdc++.h>
using namespace std;

int main() {
    int tt;
    cin >> tt;
    
    while (tt--) {
        int n, m;
        cin >> n >> m;
        
        string s, t;
        cin >> s >> t;
        
        if (s == t) {
            cout << 0 << endl;
            continue;
        } else if (s[0] != t[0]) {
            cout << -1 << endl;
            continue;
        } else {
            int flag = 0;
            for (int i = 0; i < min(n, m); i++) {
                if (s[i] != t[i]) {
                    flag = 1;
                    break;
                }
            }
            if (flag == 0) {
                cout << 1 << endl;
            } else {
                cout << 2 << endl;
            }
        }
    }
    return 0;
}
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

why is in gcd(hard) question, printing matrix with all number as 2 is wrong?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I have a question for those who solved problem Div1C (Div2D) Prefix Suffix Min Max ,

How did u figured out the solution ? did u solve almost similar problem before or solved it just now ?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

i liked array concatenation (although could not solve in contest)