Package test; import java.io.*; public class Test { public static void main(String[] args) throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); String line = in.readLine(); int N = Integer.parseInt(line); boolean[] mas = new boolean[N]; String line2 = in.readLine(); int K = Integer.parseInt(line2); for(int x = 0; x < N; x++){mas[x]=false;} for(int z = 0; z < K; z++){String line1 = in.readLine(); int P = Integer.parseInt(line1); for(int i = P - 1; i < N; i = i + P){if (mas[i] == false) {mas[i]=true;} else mas[i] = false; } } for(int l = 0; l < N; l++){if(mas[l]==true){System.out.println("+");} else System.out.println("-"); } }}
import java.io.*;
public class Test { public static void main(String[] args) throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
int N = Integer.parseInt(line);
boolean[] mas = new boolean[N];
String line2 = in.readLine();
int K = Integer.parseInt(line2);
for(int x = 0; x < N; x++){mas[x]=false;}
for(int z = 0; z < K; z++){String line1 = in.readLine();
int P = Integer.parseInt(line1);
for(int i = P - 1; i < N; i = i + P){if (mas[i] == false) {mas[i]=true;}
else mas[i] = false;
}
}
for(int l = 0; l < N; l++){if(mas[l]==true){System.out.println("+");}
else System.out.println("-"); } }}
101101 = 1∙2^5 + 0∙2^4 + 1∙2^3 + 1∙2^2 + 0∙2^1 + 1∙2^0 = 45:16=2D(16с.сч.)
101011011 = 1∙2^8 + 0∙2^7 + 1∙2^6 + 0∙2^5 + 1∙2^4 + 1∙2^3 + 0∙2^2 + 1∙2^1 + 1∙2^0 = 347:8:8=533(8с.сч.)
101011011 = 1∙2^8 + 0∙2^7 + 1∙2^6 + 0∙2^5 + 1∙2^4 + 1∙2^3 + 0∙2^2 + 1∙2^1 + 1∙2^0 = 347:16:16=15B(16с.сч.)
11110111011 = 1∙2^10 + 1∙2^9 + 1∙2^8 + 1∙2^7 + 0∙2^6 + 1∙2^5 + 1∙2^4 + 1∙2^3 + 0∙2^2 + 1∙2^1 + 1∙2^0 = 1979:8:8:8=3673(8с.сч)
11110111011 = 1∙2^10 + 1∙2^9 + 1∙2^8 + 1∙2^7 + 0∙2^6 + 1∙2^5 + 1∙2^4 + 1∙2^3 + 0∙2^2 + 1∙2^1 + 1∙2^0 = 1979:16:16=7BB(16с.сч.)
100000001110 = 1∙2^11 + 0∙2^10 + 0∙2^9 + 0∙2^8 + 0∙2^7 + 0∙2^6 + 0∙2^5 + 0∙2^4 + 1∙2^3 + 1∙2^2 + 1∙2^1 + 0∙2^0 = 2062:8:8:8=4016(8с.сч.)
100000001110 = 1∙2^11 + 0∙2^10 + 0∙2^9 + 0∙2^8 + 0∙2^7 + 0∙2^6 + 0∙2^5 + 0∙2^4 + 1∙2^3 + 1∙2^2 + 1∙2^1 + 0∙2^0 = 2062:16:16=80Е(16с.сч.)