ICode9

精准搜索请尝试: 精确搜索
  • 性感素数2022-08-21 11:02:15

    题目描述 "性感素数"是指形如 (p,p+6) 这样的一对素数。 之所以叫这个名字,是因为拉丁语管“六”叫“sex”(即英语的“性感”)。 现给定一个整数,请你判断其是否为一个性感素数。 输入格式 输入在一行中给出一个正整数 N。 输出格式 若 N 是一个性感素数,则在一行中输出 Yes,并在第二行

  • 692022-08-15 13:32:51

    turn 转动       repeat 重复 judge 法官 floor 地面 salt 盐 discharge 免除 story 故事 definite 一定的 daughter 女儿 disaster 灾难 entire 全部的 during 在...期间 seat 座位 near 近的 corn 玉米 settlement 解决 travel 旅行 great 伟大的 kitchen 厨

  • 砍树2022-08-11 10:02:31

    P1873 [COCI 2011/2012 #5] EKO / 砍树 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 二分高度 judge中把比这个高度高的砍去(加上),看是不是满足条件 #include <bits/stdc++.h> using namespace std; #define ll long long #define MAX 10000001 int n, m; int datas[MAX]; bool

  • 素数筛法2022-07-25 23:34:50

    素数筛法 1.埃氏筛法 这个方法就是利用质数的倍数必然不是质数来解决的。然后每一次都会把这个质数后面所有的数都筛一遍 #include<iostream>using namespace std;const int N=1e8+100;int n,prime[6000000],cnt,q;bool isprime[N];void judge(int n){ for(int i=2;i<=n;i++){/

  • VJ-11 个人赛2022-06-10 20:37:25

    bookshelf filling  二分,从右边的长度为b的书中选tt本,看上面剩下的空间能否摆下tt本。因为tt的值越小,越有可能摆下,所以满足二分的性质。 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5+10; int a,b,h; ll n,m; bool judge(ll tt) {

  • VJ-11 个人赛2022-06-10 20:37:25

    bookshelf filling  二分,从右边的长度为b的书中选tt本,看上面剩下的空间能否摆下tt本。因为tt的值越小,越有可能摆下,所以满足二分的性质。 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5+10; int a,b,h; ll n,m; bool judge(ll tt) {

  • 7-6 sdut-字母替换2022-05-29 09:34:56

    方法一:使用list judge = [] for i in range(26): judge.append( chr(65+25-i) ) # print(judge) n= input() n= [judge[ord(i)-65] if 'A'<=i<='Z' else i for i in n] print(''.join(n)) 方法2:使用map judge = {} for i in range(26):

  • 函数柯里化第一版2022-05-09 22:31:07

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="w

  • Daimayuan Online Judge #558. 快快变大2022-03-19 09:05:24

    #include<bits/stdc++.h> using namespace std; #define int long long #define debug cout<<"!!!"<<endl; #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define ROF(i, a, b) for (int i = (a); i >= (b); i--) const int N =

  • Java中的自定义异常2022-02-25 21:02:04

    当我们的程序中出现某种错误,但是我们的Exception并没有对其进行详细的描述,这时我们可以自定义异常,来显示信息。 我们自定义异常类去继承Exception类或者RuntimeException如果继承Exception则属于编译异常如果继承RuntimeException,则输入运行异常 下面的这中情况是自定义编译异常

  • Java中throws与throw的区别2022-02-25 20:57:59

    throws异常处理的一种方式,用在方法声明处,后面是异常的类型throw手动生成异常对象的关键字,在方法体中,后面是异常的对象 package Learn; public class Test { public static void main(String[] args) throws Judge { int age=152; if (age<=10||age>=120){

  • Node: 将时间戳转换成日期并分组2022-02-16 09:01:59

    // 对时间戳按日期进行分组 let moment = require('moment') let timestamp_array = [ 1645059333000, 1613523333000, 1297904133000, 1298076933000, 1582073733000, 1645318535000, 1647389537000 ] let result = {} for (let index in timestamp_array)

  • UVA489 刽子手的游戏 Hangman Judge 题解2022-02-02 23:03:17

    题意翻译 刽子手游戏是一款猜单词游戏,计算机想一个单词让你猜,你每次可以猜一字母 如果单词里有那个字母,所有该字母会显示出来。(例如“book”,如果猜字母“o”,则两个o都会显示出来) 如果没有那个字母,则计算机会在一幅“刽子手”画上填一 笔。这幅画一共需要7 笔就能完成,因此你最

  • JNOJ部署教程(4)—开机启动判题机2022-02-01 18:33:43

    原文链接:这里   我们使用的ubuntu18重启后判题机默认不能启动。我们需要配置一下让判题机开机启动。 判题机开机启动 以下内容均需要 root 权限。非 root 用户可使用 sudo。 1. Judge 将以下内容保存创建为 jnoj-judge.service,保存为 /etc/systemd/system/jnoj-judge.servi

  • JNOJ提示”删除失败:opendir(/home/judge/jnoj/config/../judge/data/1051): failed to open dir: No such file or2022-02-01 18:31:37

    原文链接:这里 0.背景 给JNOJ导入题目之后,发现题目不合适想删除题目,但是删除的时候直接报错:”删除失败:opendir(/home/judge/jnoj/config/../judge/data/1051): failed to open dir: No such file or directory“ 十分奇怪! 1.问题原因及解决办法 顺着目录去找了一下,发现服务器这个

  • JNOJ部署教程(3)—项目目录结构2022-02-01 18:00:39

    原文链接:这里   项目目录 hom/judge/jnoj assets/ 资源文件的定义 commands/ 控制台命令 components/ Web 应用程序组件 config/ Web 应用程序配置信息 controllers/ 控制器(Controller)文件 docs/

  • judge_raw_align.py2022-01-29 10:32:50

    from collections import Counter with open('/dnn4_added/fuyongze/tr/vt/base/align_test.txt', 'r')as align_f, open('/dnn4_added/fuyongze/tr/vt/base/raw_test.txt', 'r') as mfcc_f: align_list = [] mfcc_list = [

  • SWUST OJ 1098: 堆的判断2022-01-10 09:34:34

    题目描述 编写程序判断以下给出的整数序列是否为最小堆。 输入 第一行是元素的个数n; 第二行是n个整数序列。 输出 如果是小根堆,输出Yes,否者输出No。 样例输入 10 100 86 48 73 35 39 42 57 66 21 样例输出 No 参考程序 #include<stdio.h> #include<stdlib.h> void judge(int

  • 【leetcode】997. Find the Town Judge2022-01-03 19:36:28

    In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Everybody (except for the town judge) trusts the town judge. There is

  • CF1354A Alarm Clock 题解2021-12-23 20:37:33

    Content 小 \(P\) 要睡足 \(a\) 分钟,他为自己设定了一个 \(b\) 分钟后的闹钟。如果在 \(b\) 分钟后闹钟响时他还是没有睡够,他会在设定一个 \(c\) 分钟的闹钟,并花费 \(d\) 分钟入眠,如果在闹钟响后他还是没有睡够,他将重复设定闹钟并花费一定时间入眠,直到他在一次闹钟响后睡够了为止

  • 剑指 Offer 26. 树的子结构(java & python)2021-12-17 17:33:24

    java: 没有感情的递归  class Solution { public boolean isSubStructure(TreeNode A, TreeNode B) { return ( A != null && B != null ) && (judge( A, B ) || isSubStructure( A.left, B) ||isSubStructure(A.right, B)); } public boolean j

  • 《中英双解》leetCode Find the town judge(找到小镇法官)2021-11-26 10:02:27

    In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Everybody (except for the town judge) trusts the town judge. There is ex

  • 489 Hangman Judge (UVA)2021-11-25 21:00:52

    目录 ​ AC source code: Vocabulary:  "turned over"is equal to elimination. AC source code: #include<iostream> #include<cstring> #include<cmath> #include<algorithm> using namespace std; char s[105]; char b[105]; int main

  • 查询多表的信息,放到一个表中(使用触发器)2021-11-21 20:01:40

    使用触发器(给要查询的表添加触发器) 假如有表single、mcq、judge 要把这三个表的数据查询出来并放到一个新表中 新表:lists 步骤1:创建一个新表,并在新表中插入字段,如下:   步骤2 :给single、mcq、judge几个表分别添加触发器(添加触发器的作用:在single、mcq、judge中添加数据时,也会在新

  • AtCoder Grand Contest 0442021-11-05 18:32:02

    题外话,昨天我写的题解被电脑重启还原卡搞没了 A - Pay to Win 题意:简单来说 题意就是 给一个N 然后给了4种操作的代价 求最小的代价。 sol.可以发现,对于每一次操作,如果要进行乘除法操作,那么肯定应该不留余数 那么只要对 数进行上下取证考虑就好了 #include<bits/stdc++.h> typede

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有