A[i]*A[i+1]的4的整数倍;为啥我的0.00%通过率

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
int i, j;
int n = int.Parse(Console.ReadLine());
List<string> result =new List<string>();
for (i = 0; i < n; i++)
{
int k = int.Parse(Console.ReadLine());
string[] str = Console.ReadLine().Split();
List<int> li = new List<int>();
for (j = 0; j < k; j++)
{
li.Add(int.Parse(str[j]));
}
int temp = li[0];
for (j = 1; j < li.Count; j++)
{
if (temp * li[j] % 4 == 0)
{
temp = li[j];
li.RemoveAt(j);
j = 0;

}
}
if (li.Count == 1)
{
result.Add("Yes");
} else
{
result.Add("No");
}
}
for (i = 0; i < result.Count; i++)
{
Console.WriteLine(result[i]);
}
Console.ReadKey();

}
}

}

#网易#
全部评论
点赞 回复 分享
发布于 2017-09-10 07:36
考虑4的倍数的个数和除4的倍数之外的二的倍数的个数就ok了
点赞 回复 分享
发布于 2017-09-10 00:52
没有考虑2的情况
点赞 回复 分享
发布于 2017-09-10 00:42
很明显错了吧,测试样例都不通过
点赞 回复 分享
发布于 2017-09-09 18:21

相关推荐

争当牛马还争不上
码农索隆:1.把简历改哈 2.猛投,狠投 3.把基础打牢 这样你在有机会的时候,才能抓住
点赞 评论 收藏
分享
VirtualBoo...:都去逗他了?
点赞 评论 收藏
分享
LemontreeN:有的兄弟有的我今天一天面了五场,4个二面一个hr面
投递字节跳动等公司9个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务