Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Possible Maximum
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here int n = Int32.Parse(Console.ReadLine()); for(int i=0; i<n; i++){ int count = 0; string[] input = Console.ReadLine().Split(' '); int N = Int32.Parse(input[0]); int inputK = Int32.Parse(input[1]); for(int j=1; j<N; j++){ int A = j; for(int k=j+1; k<=N; k++){ int B = k; var c = A&B; // Console.WriteLine("A " +A+" B "+B+ " A&B " + c); if(A<B && c < inputK ){ if(count <c){ // Console.WriteLine(c); count = c; } } } } Console.WriteLine(count); } //Your code end here } } }
run
|
edit
|
history
|
help
0
("Hello, world!\n");
Cast int to enum in C#
cs002
IntNull
Programmer DNA
events
Execution flow of static and normal constructor of base and derived class.
Lazy exception caching
Find duplicates in a given integer array
w