Artin_Zer0's blog

By Artin_Zer0, history, 2 days ago, In English

Today Codeforces has reached its 400,000,000th submission

I thought it would be interesting to create a leaderboard of the users who got closest to this milestone, both before and after it.

Rank Handle Submission ID Distance
1 ItsNotMeItsYou 400000000 0
2 Aria_glmdy 399999998 2
3 Ashar0n 399999997 3
4 PieArmy 400000004 4
5 amodi 399999995 5
5 SummerSky 400000005 5
7 qvox177 399999994 6
8 Artin_Zer0 399999990 10
8 silver32 400000010 10
10 esc_qwq 399999989 11
10 neil2024 400000011 11
12 Lgdony 399999986 14
12 shivani9935 400000014 14
14 sidlad 399999985 15
15 Rayyan_Wasiq 400000017 17
16 QWQ_SczyYA 399999981 19
17 ballss 399999975 25
18 impbz 400000026 26
19 qinglin_zcr 400000029 29
20 Omar_2014_07 399999968 32
20 misytnikita 400000032 32

I genuinely hope I'll still be active on Codeforces when we reach #500,000,000 which should happen in about two years.

And also If someone is missing from this leaderboard let me know in the comments.

Full text and comments »

  • Vote: I like it
  • +33
  • Vote: I do not like it

By Artin_Zer0, history, 13 months ago, In English

It has probably happened to everyone that they try to solve a problem, but get a WA (Wrong Answer) or TLE (Time Limit Exceeded) on one of the tests. They want to find the specific test case where their code failed, but in many cases, that test case cannot be found on the submission page.

But...

I’ve found a good solution to this problem. It’s possible that we can’t find the test case on the input page, but we can find it on the output page of our own code. This can be done by making our code’s output correspond to only that single test case.

Like in the following code:

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

int main(){
  ios_base::sync_with_stdio(0);cin.tie(0);
  int Tc;
  cin >> Tc;   
  int Cnt_Tc = Tc; // Count of test cases
  bool Tcc = false; // If you want to know which test case that is
  int F_Tc = 352; // The test case where your code failed
  while(Tc--) { 
    if(Tc == Cnt_Tc - F_Tc && Tcc){
      /*
          Print input
      */  
      int n;
      cin >> n;
      vector<int> a(n);
      for(auto &x : a) cin >> x;
      cout << n << endl;
      for(auto &x : a) cout << x << " ";
      cout << endl;
    }
    else if(!Tcc){
      /*
            Main code
      */  
      int n;
      cin >> n;
      vector<int> a(n);
      for(auto &x : a)cin >> x;
      int s = 0;
      for(auto &x : a)s += x;
      cout << s << endl;
    }
    else{
      /*
            Just cin extra input
      */  
      int n;
      cin >> n;
      vector<int> extra(n);
      for(auto &x : extra) cin >> x;
    }
  }
  return 0;
}

If this blog helped you, please upvote it :)

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it