Please read the new rule regarding the restriction on the use of AI tools. ×

Darshansinghbisht's blog

By Darshansinghbisht, history, 10 months ago, In English

Problem:746B -Decoding

  • language:C++
  • status: accepted

#include<iostream> #include<bits/stdc++.h> using namespace std; string reverse (string input){ string rev; for (int i=input.length()-1;i>=0;i--){ rev+=input[i]; } return rev; } string solve(){ int n; cin>>n; string s; cin>>s; string a; //last string b; //first if(n%2==0){ for(int i=n-1;i>=0;i--) { if(i%2==0) a=a+s[i]; else b=b+s[i]; }} else{ for(int i=n-1;i>=0;i--) { if(i%2==0) b=b+s[i]; else a=a+s[i]; } } // cout<<a<<endl; // cout<<b<<endl; cout<< a+reverse(b); } int main(){ solve(); }

Full text and comments »

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

By Darshansinghbisht, history, 15 months ago, In English

I was solving the following problem @ 479A — Expression

I feel that the given test case had a wrong output.

Test: #8, time: 0 ms., memory: 0 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWER

Input 6 7 1 Output 49 Answer 48

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it