QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75686 | #4832. Telepathy | Appleblue17 | 0 | 17ms | 4404kb | C++14 | 1.2kb | 2023-02-06 08:00:01 | 2023-02-06 08:00:05 |
Judging History
answer
//#include<bits/stdc++.h>
//using namespace std;
//const int N=1e6+5,mod=998244353;
//int n,m,ans;
//int f[N];
//
//void dfs(int dep){
// if(dep==2*m){
// int tot=0,cor=0;
// for(int S=0;S<m;S++){
// for(int T=0;T<m;T++){
// tot++;
// int x=S>>f[T+m] & 1,y=T>>f[S] & 1;
// if(x==y) cor++;
// }
// }
// if(cor>ans){
// ans=cor;
// cout<<cor<<"/"<<tot<<": ";
// for(int i=0;i<2*m;i++) cout<<f[i]<<",";
// cout<<'\n';
// }
// return ;
// }
// for(int i=0;i<n;i++){
// f[dep]=i;
// dfs(dep+1);
// }
//}
//
//int main(){
// cin>>n;
// m=1<<n;
// dfs(0);
//}
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int n,k;
char S[N];
namespace Flim{
int f[8]={0,0,1,0,2,2,1,0};
void main(){
cin>>n>>k;
scanf("\n%s",S+1);
for(int i=1;i<=k;i++){
int l=i*3,r=i*3+2;
int mac=(S[l]-'0')+(S[l+1]-'0')*2+(S[l+2]-'0')*4;
cout<<l+f[mac]<<" ";
}
}
}
namespace Flam{
int f[8]={0,0,1,1,2,0,2,0};
void main(){
cin>>n>>k;
scanf("\n%s",S+1);
for(int i=1;i<=k;i++){
int l=i*3,r=i*3+2;
int mac=(S[l]-'0')+(S[l+1]-'0')*2+(S[l+2]-'0')*4;
cout<<l+f[mac]<<" ";
}
}
}
int main(){
cin>>S;
if(S=="Flim") Flim::main();
else Flam::main();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 17ms
memory: 4404kb
input:
Flim 1000000 100000 1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...
output:
5 6 9 12 15 18 21 25 29 30 33 36 39 42 47 48 51 54 57 60 63 66 69 72 75 78 82 85 87 92 93 97 99 104 107 108 111 116 119 120 123 128 129 134 135 138 142 145 147 151 153 157 161 164 167 170 171 176 178 180 185 186 189 192 197 200 203 206 209 210 215 218 219 223 226 229 231 235 237 240 245 246 250 254 ...
input:
Flam 1000000 100000 0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...
output:
3 8 10 14 15 18 21 25 28 30 34 38 40 42 46 49 52 54 59 61 65 66 70 73 76 79 81 84 88 90 95 96 99 102 105 109 111 116 119 120 125 128 131 134 137 139 142 146 148 152 154 158 159 162 165 168 171 176 177 181 183 186 189 194 197 198 203 204 208 212 214 216 219 222 225 228 233 234 238 241 243 248 250 252...
result:
wrong answer 59535 matched, but you need to match at least 66666 positions