aliawadhi's blog

By aliawadhi, history, 6 days ago, In English,

 I tried to submit for this question, but it seems that there is not answer.txt file to compare to and the judgement was "Denial by judgement". I thought that maybe my code is wrong, so I copied another code that previously got an "Accepted" answer for this question and submitted it. However, the output was still "Denial by judgement". Can you please help me out with this?

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

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by aliawadhi (previous revision, new revision, compare).

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by aliawadhi (previous revision, new revision, compare).

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can you share your code?

  • »
    »
    6 days ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    This is my code:

    include <bits/stdc++.h>

    using namespace std;

    using ll = long long;

    int main()

    {

    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int start = 0;
    int end = n/2;
    while(end<=n-1)
    {
        if(s[start]=='L'&&s[end]=='R')
        {
            cout<<start+1<<" "<<end+1<<"\n";
        }
        else if(s[start]=='R'&&s[end]=='L')
        {
            cout<<end+1<<" "<<start+1<<"\n";
        }
        else
        {
            cout<<start+1<<" "<<end+1<<"\n";
        }
        start++;
        end++;
    }
    
    return 0;

    }

»
6 days ago, # |
  Vote: I like it +8 Vote: I do not like it

As mentioned in the problem you have to take the input from file and print output in file .

include these line of code just after starting of main function

freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

»
5 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Update: The question has been resolved. Thank you guys for the help.