CSES - Datatähti Open 2021 - Results
Submission details
Task:Split in Three
Sender:dusty_sky
Submission time:2021-01-30 18:47:32 +0200
Language:C++ (C++17)
Status:READY
Result:22
Feedback
groupverdictscore
#1ACCEPTED22
#20
Test results
testverdicttimegroup
#1ACCEPTED0.01 s1, 2details
#2ACCEPTED0.01 s1, 2details
#3ACCEPTED0.01 s1, 2details
#4ACCEPTED0.01 s1, 2details
#5ACCEPTED0.01 s1, 2details
#6ACCEPTED0.01 s1, 2details
#7ACCEPTED0.01 s1, 2details
#8ACCEPTED0.01 s1, 2details
#9--2details
#10--2details
#11--2details
#12ACCEPTED0.01 s2details
#13--2details
#14--2details
#15ACCEPTED0.01 s2details

Compiler report

input/code.cpp: In function 'void rep(st, ll)':
input/code.cpp:48:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0;i<ss.size();i++)cout<<ss[i]<<" ";
                     ~^~~~~~~~~~

Code

#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define T true
#define F false
#define fi first
#define endl "\n"
#define se second
#define DIM 100001
#define pb push_back
#define amen exit(0);
#define qwe return 0;
#define eps 0.0000001
#define mod 1000000007
#define INF 1000000000001
#define gg cout<<"OPS"<<endl;
#define PI 3.1415926535897932384626433
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define time cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
typedef char ch;
typedef bool boll;
typedef string st;
typedef long long ll;
typedef long double ld;
typedef set < string > sst;
typedef set < long long > sll;
typedef unsigned long long ull;
typedef queue < long long > que;
typedef deque < long long > deq;
typedef vector < long long > vec;
typedef map < long long, long long > mll;
typedef pair < long long, long long > pll;
typedef pair < long long, unsigned long long > pul;
typedef vector < pair < long long, long long > > vpl;
typedef tree <ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> myset;
ll n,z,x,s;
void rep (st ss, ll len){
   if(len==n){
     ll x1=0,x2=0,x3=0;
     for(ll i=1;i<=n;i++){
       if(ss[i-1]=='1')x1+=i;
       else if(ss[i-1]=='2')x2+=i;
       else x3+=i;
     }
     if(x1+1==x2 && x2+1==x3){
        for(int i=0;i<ss.size();i++)cout<<ss[i]<<" ";
        cout<<endl;
     }
   }
   else{
     len++;
     rep(ss+"1",len);
     rep(ss+"2",len);
     rep(ss+"3",len);
   }
}
int main()
{
     fast;
     cin>>n;
     if((n-1)%3==0)return cout<<"IMPOSSIBLE"<<endl,0;
     st ss="1";
     rep(ss,1);
     ss="2";
     rep(ss,1);
     ss="3";
     rep(ss,1);
     //time;
}

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
3

correct output
1 2 3 

user output
1 2 3 

Test 2

Group: 1, 2

Verdict: ACCEPTED

input
4

correct output
IMPOSSIBLE

user output
IMPOSSIBLE

Test 3

Group: 1, 2

Verdict: ACCEPTED

input
5

correct output
1 3 1 3 2 

user output
1 3 1 3 2 
3 2 2 1 3 
3 3 3 1 2 

Test 4

Group: 1, 2

Verdict: ACCEPTED

input
6

correct output
1 3 2 2 1 3 

user output
1 3 2 2 1 3 
2 1 3 1 3 2 
2 2 3 2 3 1 
3 2 3 3 2 1 
3 3 2 2 3 1 

Test 5

Group: 1, 2

Verdict: ACCEPTED

input
7

correct output
IMPOSSIBLE

user output
IMPOSSIBLE

Test 6

Group: 1, 2

Verdict: ACCEPTED

input
8

correct output
2 3 1 2 3 3 2 1 

user output
1 1 1 2 1 3 3 2 
1 1 2 2 2 3 3 1 
1 1 3 3 2 3 2 1 
1 2 1 2 3 2 1 3 
1 2 2 1 3 1 2 3 
...
Truncated

Test 7

Group: 1, 2

Verdict: ACCEPTED

input
9

correct output
1 2 3 1 2 3 3 2 1 

user output
1 1 1 2 2 2 3 1 3 
1 1 1 3 3 2 3 1 2 
1 1 2 2 1 1 3 2 3 
1 1 3 1 3 2 1 3 2 
1 1 3 3 1 1 2 
...
Truncated

Test 8

Group: 1, 2

Verdict: ACCEPTED

input
10

correct output
IMPOSSIBLE

user output
IMPOSSIBLE

Test 9

Group: 2

Verdict:

input
42

correct output
1 3 2 2 1 3 1 2 3 3 2 1 1 2 3 ...

user output
(empty)

Test 10

Group: 2

Verdict:

input
95

correct output
1 3 1 3 2 1 2 3 3 2 1 1 2 3 3 ...

user output
(empty)

Test 11

Group: 2

Verdict:

input
96

correct output
1 3 2 2 1 3 1 2 3 3 2 1 1 2 3 ...

user output
(empty)

Test 12

Group: 2

Verdict: ACCEPTED

input
97

correct output
IMPOSSIBLE

user output
IMPOSSIBLE

Test 13

Group: 2

Verdict:

input
98

correct output
2 3 1 2 3 3 2 1 1 2 3 3 2 1 1 ...

user output
(empty)

Test 14

Group: 2

Verdict:

input
99

correct output
1 2 3 1 2 3 3 2 1 1 2 3 3 2 1 ...

user output
(empty)

Test 15

Group: 2

Verdict: ACCEPTED

input
100

correct output
IMPOSSIBLE

user output
IMPOSSIBLE