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
https://www.usgatmtu.mtu.edu/profile/watch-the-bad-guys-online-streaming/profile
Display the pattern like diamond by using c# for loop
Find smallest and largest in unsorted array
凑单
int array element change with xor
CodeAdvent
C# Basic learning
Print dulicate chars in a string
SortedDictionary : Add と foreach
ejemplo c# 2