Task: | Split in Three |
Sender: | dusty_sky |
Submission time: | 2021-01-30 18:42:38 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 22 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 22 |
#2 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2 | details |
#2 | ACCEPTED | 0.01 s | 1, 2 | details |
#3 | ACCEPTED | 0.01 s | 1, 2 | details |
#4 | ACCEPTED | 0.01 s | 1, 2 | details |
#5 | ACCEPTED | 0.01 s | 1, 2 | details |
#6 | ACCEPTED | 0.01 s | 1, 2 | details |
#7 | ACCEPTED | 0.01 s | 1, 2 | details |
#8 | ACCEPTED | 0.01 s | 1, 2 | details |
#9 | TIME LIMIT EXCEEDED | -- | 2 | details |
#10 | TIME LIMIT EXCEEDED | -- | 2 | details |
#11 | TIME LIMIT EXCEEDED | -- | 2 | details |
#12 | TIME LIMIT EXCEEDED | -- | 2 | details |
#13 | TIME LIMIT EXCEEDED | -- | 2 | details |
#14 | TIME LIMIT EXCEEDED | -- | 2 | details |
#15 | TIME LIMIT EXCEEDED | -- | 2 | details |
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; amen; } } else{ len++; rep(ss+"1",len); rep(ss+"2",len); rep(ss+"3",len); } } int main() { fast; cin>>n; st ss="1"; rep(ss,1); ss="2"; rep(ss,1); ss="3"; rep(ss,1); cout<<"IMPOSSIBLE"<<endl; //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 |
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 |
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 |
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 |
Test 8
Group: 1, 2
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 9
Group: 2
Verdict: TIME LIMIT EXCEEDED
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: TIME LIMIT EXCEEDED
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: TIME LIMIT EXCEEDED
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: TIME LIMIT EXCEEDED
input |
---|
97 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
(empty) |
Test 13
Group: 2
Verdict: TIME LIMIT EXCEEDED
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: TIME LIMIT EXCEEDED
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: TIME LIMIT EXCEEDED
input |
---|
100 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
(empty) |