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

Автор mihir, 9 лет назад, По-английски

Hi, yesterday, I was solving a problem from the IARCS judge and my solution was accepted for all the test cases except one. For that particular test case, the output was SIGABRT error. I tried to figure out why I was getting this error but to no avail. If you can figure out why I am getting this error then please let me know.

The link to the problem — Problem

My solution to the problem —

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

#define ll long long
 
int main()
{
    ll N, K;
    cin>>N>>K;
    
    set< ll int> S;
    
    while(K-- )
    {
        ll X;
        cin>>X;
        
        for(int i=1; i<=N; i = i + X)
        {
            S.insert(i);
        }
    }
    
    cout<<N - S.size();
}

My solution was failing the 7th test case to the problem. The test cases for the problem can be found over here — Testcases This solution worked fine for the 7th test case when I tried it on codechef's IDE and codeforces custom test.

My solution was failing the 7th test case only due to which I only managed to get 90/100 for this problem. If you can point out the mistake in my solution and let me know about it then I would appreciate your help.

Полный текст и комментарии »

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

Автор mihir, 9 лет назад, По-английски

Hi, yesterday I solved problems 513A, 466A, 448A, 160B, 266B and 456A. Although the solutions to these problems were accepted, today when I checked the problemset page, it showed that I got a wrong answer and I still have to solve these problems. On the problem statement page and my submission history it correctly shows that I have solved the problem.

Here is the problemset page where it shows that the submission is wrong —

Here is my submission history where it shows that the problem has been accepted —

This is the same for some other problems as well.

EDIT — Every solution to the problem that I solve is being shown as wrong even though it has been accepted.

UPDATE — The bug seems to be fixed.

Полный текст и комментарии »

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