122 |
|
a1 第一项
d 是公差
第n项 : an = a1 + (n-1) * d
前n项和公式为:Sn=a1n+[n(n-1)d]/2 或 Sn=[n(a1+an)]/2。
a=ceil(a1.0/c)c;
max(a,b)求a,b的较大值
min(a,b)求a,b的较小值
swap(a,b)交换a,b变量的值
abs(a)a的绝对值
pow(a,b)求出a的b次方,返回值是double
ex:pow(2,3)=222=8
pow(16,1.0/2)=4;
sqrt(a)开根号
round(a)
floot(a)
ceil(a)
一维数组顺序排序函数sort(a+1,a+n+1,cmp)
1、 开根号 sqrt(16) = 4.0
2、 绝对值 abs(-1) = 1
3、 最大值 max(1, 2) = 2
4、 最小值 min(1, 2) = 1
5、 幂次方 pow(2, 3) = 2 * 2 * 2 = 8 //2的3次方
6、 三元运算符 条件 ? 条件成立执行 : 条件不成立执行 1 == 1 ? a : b
7、 四舍五入函数 round(4.1) = 4.0 , round(4.5) = 5.0
8、 向上取整 ceil(4.1) = 5.0, ceil(4.5) = 5.0
9、 向下取整 floor(4.1) = 4.0, floor(4.5) = 4.0
NB
小黑蛋
蛋仔派对
身法蛋
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << "ABADCCABCCCCBCC"<<endl;
cout << "FTFTFFFTTF";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
001110001001010
cout << "ABADCCABCCCCBCC"<<endl;
0101101111
cout << "FTFTFFFTTF";
return 0;
}
浮点数比较
1.0-0.9 = 0.1 ?(计算机不一定,存的二进制,有的十进制转二进制除不尽,存接近的值) 浮点数比较正确的做法
if (abs(a - b) < 1e-9)
一个汉字占两个字节!!!
string str = "陈A歹";
cout << str.find("A") << '\n';
前加加和后加加的区别
int i = 1;
前加加, ++i, i 当前i变成2
后加加, i++, i 在下一行i变成2
char x=65;
cout<<++x<<endl; char x=65;
cout<<x++<<endl;
ykjtest
123456
Luogu P1706 全排列问题
#include <iomanip>
#include <iostream>
using namespace std;
int n;
bool vis[50]; int a[50];
void dfs(int step) {
if (step == n + 1) { for (int i = 1; i <= n; i++) {
cout << setw(5) << a[i]; }
cout << endl;
return;
}
for (int i = 1; i <= n; i++) {
if (!vis[i]) { vis[i] = true;
a[step] = i;
dfs(step + 1);
vis[i] = false; }
}
return;
}
int main() {
cin >> n;
dfs(1);
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m,x,y,a[110][110],u[10010],u1[10010];
cin>>m;
cin>>x>>y;
for(int i=1;i<=m;i++){
int loc;
cin>>loc;
}
return 0;
}
getline(cin,s);
void dfs(int step){
if(到达目的地){ 输出解}else{
for(int i=1;i<=算符总数;i++){ if(满足条件){ 保存结果 dfs(step+1); 恢复:保存结果之前的状态 }
}
}
}
#include <bits/stdc++.h>
using namespace std;
int n,m;
char a[110][110];
int v[110][110],max=-10000;
bool f(int v){
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(v[i][j]==0)return 0;
}
}
return 1;
}
void dfs(int step,int sum=0) {
if (f(v) == 1) {
if(sum>max)max=sum;
sum=0;
return;
} else {
for (int i = 1; i <= n; i++) {
for(int j=1;j<=m;j++){
if (vis[i][j] == 0) {
sum++;
vis[i][j] = 1;
dfs(step + 1);
vis[i][j] = 0;
}
}
}
}
}
int main() {
cin >> n >> m;
dfs(1);
cout<<max;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int n,t,v[110][110],sx,sy,ex,ey,f=0;
char a[110][110];
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
void c()
void dfs(int x,int y) {
if(x==ex and y==ey){
f=1;
return ;
}
for(int i=0;i<4;i++){
int nx=x+dx[i];
int ny=y+dy[i];
if(nx>=0 and nx<n and ny>=0 and ny<n and v[nx][ny]==0 and a[nx][ny]!='#')
{
v[nx][ny]=1;
dfs(nx,ny);
}
}
}
int main(){
cin>>t;
while(t--){
f=0;
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>a[i][j];
}
}
int ax,ay,bx,by;
cin>>ax>>ay>>bx>>by;
dfs(ax,ay);
if(f==1)cout<<"YES\n";
else cout<<"NO\n";
}
return 0;
}
|
352 |
1500 |
140 |
|
<!-- <link href="/self/style.css?20181212" rel="stylesheet"> -->
<link href="/cdnjs/morris.js/0.5.1/morris.css" rel="stylesheet">
<script src="/markdown-palettes/sweetalert.min.js"></script>
<link href="/google-fonts/fira-mono.css" rel="stylesheet">
<link href="/google-fonts/lato.css" rel="stylesheet">
<link href="/google-fonts/open-sans.css" rel="stylesheet">
<link href="/google-fonts/exo-2.css" rel="stylesheet">
<script src="/self/shortcut.js"></script>
<script>
shortcut.add("Alt+L", function () {
window.location.href = location.protocol + '//' + location.host + "/user_unlock?url=%2Fuser%2F2029";
});
</script>
<div class="ui fixed borderless menu" style="position: fixed; height: 49px; ">
<div class="ui container">
<a href="/"><img src="/logo/login_logo.png" style="width: 45px; height: 45px; "></a>
<a style="font-weight:bold;" class="item" href="/"><i class="home icon"></i> 首页</a>
<a style="font-weight:bold;" class="item" href="/problems"><i class="list icon"></i> 题库</a>
<a style="font-weight:bold;" class="item" href="/schedules"><i class="book icon"></i> 题单</a>
<a style="font-weight:bold;" class="item" href="/training"><i class="pencil icon"></i> 训练</a>
<a style="font-weight:bold;" class="item" href="/contests"><i class="calendar icon"></i> 比赛</a>
<a style="font-weight:bold;" class="item" href="/corrections"><i class="check icon"></i> 订正</a>
<a style="font-weight:bold;" class="item" href="/submissions"><i class="tasks icon"></i> 评测</a>
<a style="font-weight:bold;" class="item" href="/ranklist"><i class="signal icon"></i> 排名</a>
<a style="font-weight:bold;" class="item" href="/discussion/global"><i class="comments icon"></i> 讨论</a>
<a style="font-weight:bold;" class="item" href="/teachers"><i class="box icon"></i> 师者</a>
<a style="font-weight:bold;" class="item" href="/calendar"><i class="calendar alternate icon"></i>近期比赛</a>
<a style="font-weight:bold;" class="item" id="theme-mode" onclick="setDark()"><i class="moon icon"></i>主题</a>
<script>
localStorage.getItem("dark-mode") && setDark();
function setLight() {
$("#dark-mode").remove();
$("#theme-mode")
.html('<i class="moon icon"></i>暗色')
.attr("onclick", "setDark()");
localStorage.removeItem("dark-mode");
}
function setDark() {
$("<link>").attr({
rel: "stylesheet",
type: "text/css",
href: "/self/dark3.css",
id: "dark-mode",
}).appendTo("head");
$("#theme-mode")
.html('<i class="sun icon"></i>明亮')
.attr("onclick", "setLight()");
localStorage.setItem("dark-mode", "1");
}
</script>
.ui.vertical.icon.menu .item .sidebar-item-text {
display: none;
}
.ui.vertical.icon.menu {
width: 48.52px;
transition: width .15s;
/* transition: width .25s; */
}
.ui.vertical.icon.menu {
overflow: hidden;
}
.ui.vertical.icon.menu.spreaded .item {
text-align: left;
width: 200px;
line-height: 16px;
}
.ui.vertical.icon.menu.spreaded .item i.icon {
display: inline-block;
margin-right: 20px;
text-align: center;
height: 16px;
font-size: 16px;
width: 16.52px;
}
.ui.vertical.icon.menu.spreaded .item .sidebar-item-text {
display: inline;
}
$('#sidebar').hover(function() {
$(this).css('width', '150px')
}, function() {
$(this).css('width', '50px')
})
<div class="right menu">
<a href="/user/5896" style="color: inherit; ">
</a><div class="ui simple dropdown item"><a href="/user/5896" style="color: inherit; ">
<p style="margin-bottom:-5px;">
<img style="border-radius:50%;vertical-align:middle;margin-bottom:2px;margin-right:2px;" src="http://61.186.173.89:2019/2021/08/19/f319c7c8e4f09.jpeg" width="30" height="30">
x20260070 <i style="font-weight:bold;" class="dropdown icon"></i>
</p></a><div class="menu"><a href="/user/5896" style="color: inherit; ">
</a><a class="item" href="/user/5896/edit"><i class="edit icon"></i>修改资料</a>
<a class="item" style="color: red !important;" href="/user_unlock?url=%2Fuser%2F2029"><i class="lock icon"></i>锁定账户</a>
<a class="item" href="/problems/user/5896"><i class="book icon"></i>我的题目</a>
<a class="item" href="/discussions_own"><i class="comments icon"></i>我的博客</a>
<a class="item" href="/files"><i class="file icon"></i>我的空间</a>
<a class="item" href="/contests_own"><i class="calendar icon"></i>我的比赛</a>
<a class="item" href="/teachers/my"><i class="id card icon"></i> 我的老师</a>
<a class="item" href="/teacher/5896"><i class="child icon"></i> 我的学生</a>
<a class="item" href="/exercises"><i class="trophy icon"></i>练习</a>
<a class="item" href="/forecast"><i class="record icon"></i>跟踪</a>
<a class="item" href="/team_my"><i class="users icon"></i>团队</a>
<a class="item" href="/chat"><i class="chat icon"></i> Chat</a>
<a class="item" href="http://222.180.160.110:10000/"><i class="computer icon"></i> 性能监控</a>
<a class="item" href="http://61.186.173.89:2019/"><i class="file image icon"></i> 图床</a>
<a class="item" href="http://222.180.160.110:6010/"><i class="cloud icon"></i> 我的云盘</a>
<a class="item" href="/help"><i class="help circle icon"></i> 帮助</a>
<a class="item" href-post="/logout?url=%2Fuser%2F2029"><i class="power icon"></i>注销</a>
</div>
</div>
</div>
</div>
<div style="margin-top: 28px;">
#avatar_container:before {
content: "";
display: block;
padding-top: 100%;
}
</div>
<div class="eleven wide column">
<div class="ui grid">
<div class="row">
<div class="sixteen wide column">
<div class="ui grid">
<div class="eight wide column">
<div class="ui grid">
<div class="row">
<div class="column">
</div>
</div>
<div class="row">
<div class="column">
</div>
</div>
<div class="row">
<div class="column">
草木有本心,何求美人折!
<i class="diamond ico
var num = 0;
function myFunction() {
num += 1
if (num == 1) {
alert("请不要再点我了!")
}
if (num == 2) {
alert("再点一下信不信我关掉你的页面!")
}
if (num == 3) {//wyh防盗专属水印
//var opened=window.open('about:blank','_self'); opened.opener=null; opened.close();
var URL = "about:blank";
window.location.replace(URL + window.location.search);
}
//wyh防盗专属水印
}
document.body.style.backgroundImage="linear-gradient(to top, #fff1eb 0%, #ace0f9 100%)";
function clickEffect() {
var balls = [];
var longPressed = false;
var longPress;//wyh防盗专属水印
var multiplier = 0;
var width, height;
var origin;
var normal;
var ctx;
const colours = ["#F73859", "#14FFEC", "#00E0FF", "#FF99FE", "#FAF15D"];
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
canvas.setAttribute(//wyh防盗专属水印
"style",
"width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;"//wyh防盗专属水印
);
const pointer = document.createElement("span");//wyh防盗专属水印
pointer.classList.add("pointer");
document.body.appendChild(pointer);
if (canvas.getContext && window.addEventListener) {
ctx = canvas.getContext("2d");
updateSize();//wyh防盗专属水印
window.addEventListener("resize", updateSize, false);//wyh防盗专属水印
loop();
window.addEventListener(
"mousedown",//wyh防盗专属水印
function (e) {
pushBalls(randBetween(10, 20), e.clientX, e.clientY);//wyh防盗专属水印
document.body.classList.add("is-pressed");
longPress = setTimeout(function () {//wyh防盗专属水印
document.body.classList.add("is-longpress");
longPressed = true;
}, 500);//wyh防盗专属水印
},
false
);
window.addEventListener(
"mouseup",
function (e) {
clearInterval(longPress);//wyh防盗专属水印
if (longPressed == true) {
document.body.classList.remove("is-longpress");
pushBalls(//wyh防盗专属水印
randBetween(
50 + Math.ceil(multiplier),
100 + Math.ceil(multiplier)//wyh防盗专属水印
),
e.clientX,
e.clientY
);
longPressed = false;//wyh防盗专属水印
}
document.body.classList.remove("is-pressed");
},
false
);
window.addEventListener(
"mousemove",
function (e) {
let x = e.clientX;
let y = e.clientY;
pointer.style.top = y + "px";//wyh防盗专属水印
pointer.style.left = x + "px";
},
false//wyh防盗专属水印
);
} else {
console.log("canvas or addEventListener is unsupported!");
}
function updateSize() {
canvas.width = window.innerWidth * 2;//wyh防盗专属水印
canvas.height = window.innerHeight * 2;
canvas.style.width = window.innerWidth + "px";
canvas.style.height = window.innerHeight + "px";//wyh防盗专属水印
ctx.scale(2, 2);
width = canvas.width = window.innerWidth;
height = canvas.height = window.innerHeight;
origin = {
x: width / 2,//wyh防盗专属水印
y: height / 2,
};
normal = {
x: width,
y: height * 233,
};
}//wyh防盗专属水印
class Ball {
constructor(x = origin.x, y = origin.y) {
this.x = x;
this.y = y;//wyh防盗专属水印
this.angle = Math.PI * 2 * Math.random();
if (longPressed == true) {//wyh防盗专属水印
this.multiplier = randBetween(14 + multiplier, 15 + multiplier);
} else {//wyh防盗专属水印
this.multiplier = randBetween(6, 12);
} //wyh防盗专属水印
this.vx = (this.multiplier + Math.random() * 0.5) * Math.cos(this.angle);
this.vy = (this.multiplier + Math.random() * 0.5) * Math.sin(this.angle);
this.r = randBetween(8, 12) + 3 * Math.random();
this.color = colours[Math.floor(Math.random() * colours.length)];
}//wyh防盗专属水印
update() {//wyh防盗专属水印
this.x += this.vx - normal.x;
this.y += this.vy - normal.y;
normal.x = (-2 / window.innerWidth) * Math.sin(this.angle);//wyh防盗专属水印
normal.y = (-2 / window.innerHeight) * Math.cos(this.angle);
this.r -= 0.3;
this.vx *= 0.9;
this.vy *= 0.9;//wyh防盗专属水印
}
}
function pushBalls(count = 1, x = origin.x, y = origin.y) {//wyh防盗专属水印
for (let i = 0; i < count; i++) {
balls.push(new Ball(x, y));
}//wyh防盗专属水印//wyh防盗专属水印
}
function randBetween(min, max) {//wyh防盗专属水印
return Math.floor(Math.random() * max) + min;
}
function loop() {
ctx.fillStyle = "rgba(255, 255, 255, 0)";
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (let i = 0; i < balls.length; i++) {
let b = balls[i];
if (b.r = 0) {
multiplier -= 0.4;
}
removeBall();
requestAnimationFrame(loop);//wyh防盗专属水印
}
function removeBall() {
for (let i = 0; i < balls.length; i++) {
let b = balls[i];
if (
b.x + b.r width ||
b.y + b.r height ||//wyh防盗专属水印
b.r a||i.xc||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e<u.length;e++)n=u[e],null!==n.x&&null!==n.y&&(o=i.x-n.x,m=i.y-n.y,l=o*o+m*m,l=n.max/2&&(i.x-=.03*o,i.y-=.03*m),t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke()))}),x(i)}var a,c,u,m=document.createElement("canvas"),d=t(),l="c_n"+d.l,r=m.getContext("2d"),x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/45)},w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o,window.onmousemove=function(n){n=n||window.event,y.x=n.clientX,y.y=n.clientY},window.onmouseout=function(){y.x=null,y.y=null};for(var s=[],f=0;d.n>f;f++){var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3})}u=s.concat([y]),setTimeout(function(){i()},100)}();//wyh防盗专属水印
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
const hitokoto = document.getElementById('hitokoto_text')
hitokoto.href = 'https://hitokoto.cn/?uuid=' + data.uuid
if (data.hitokoto.length <= 20)
hitokoto.innerText = data.hitokoto
})
.catch(console.error)//wyh防盗专属水印
window.onload = function () {
//禁止F12
$("*").keydown(function (e) {//判断按键
e = window.event || e || e.which;
if (e.keyCode == 123) {
e.keyCode = 0;
return false;
}
});//wyh防盗专属水印
//禁止审查元素
$(document).bind("contextmenu",function(e){
return false;
});
};
//wyh防盗专属水印
//按键触发
document.onkeydown = function(){
//禁止ctrl+u
if (event.ctrlKey && window.event.keyCode==85){
return false;
}
//禁止 F12
if (window.event && window.event.keyCode == 123) {
event.keyCode = 0;
event.returnValue = false;
}
}
//网站禁止右键
document.body.oncontextmenu = function() {
self.event.returnValue=false
};
//直接上干货:
if(document.all){
document.onselectstart= function(){return false;}; //for ie
}else{
document.onmousedown= function(){return false;};
document.onmouseup= function(){return true;};
}
document.onselectstart = new Function('event.returnValue=false;');
//劫持开始选择事件和(或)鼠标按下、抬起事件。
//禁用右键(防止右键查看源代码)
window.oncontextmenu=function(){return false;}
//禁止任何键盘敲击事件(防止F12和shift+ctrl+i调起开发者工具)
window.onkeydown = window.onkeyup = window.onkeypress = function () {
window.event.returnValue = false;
return false;
}
//如果用户在工具栏调起开发者工具,那么判断浏览器的可视高度和可视宽度是否有改变,如有改变则关闭本页面
var h = window.innerHeight,w=window.innerWidth;
window.onresize = function () {
if (h!= window.innerHeight||w!=window.innerWidth){
window.close();
window.location = "about:blank";
}
}
//绑定在了body上,也可以绑定在其他可用元素行,但是不是所有元素都支持copy事件。
if (event.ctrlKey && window.event.keyCode==67){
copy: function(e) {//copy事件
let cpTxt = "复制的数据";
let clipboardData = window.clipboardData; //for IE
if (!clipboardData) { // for chrome
clipboardData = e.originalEvent.clipboardData;
}
let result = clipboardData.getData("text")+":"+cpTxt;
//e.clipboardData.getData('text');//可以获取用户选中复制的数据
clipboardData.setData('Text', result);
$('p').text(result);
return false;//否则设不生效
}
function my_function() {//替换demo里面的文本内容
document.getElementsByClassName("group").innerHTML = "管理员";
}
document.addEventListener('copy', function(e) {
e.preventDefault();//这句很重要,决定setData是否成功
var textArr = window.getSelection().toString().split("\t");
var pasteText = '';
textArr.forEach(function(e){
pasteText += e;
});
e.clipboardData.setData('text', pasteText);
});
<!--
.main-container {
display: flex;
Justify-content: center;
align-items: center;
border-radius: 80px;
text-align: center;
position: relative;
height: 63px;
width: 66px;
animation: flicker 3s infinite;
background: #000829;
margin-top: 20px;
}
@keyframes flicker {
0% {
opacity: 1;
}
18% {
opacity: 1;
}
19% {
opacity: 0;
}
20% {
opacity: 1;
}
96% {
opacity: 1;
}
97% {
opacity: 0;
}
98% {
opacity: 1;
}
}
.countries-container {
display: flex;
justify-content: flex-start;
align-items: center;
position: absolute;
height: 96%;
width: 96%;
border-radius: 100px;
overflow: hidden;
z-index: 2;
}
.countries {
position: absolute;
animation: axis-spin 5s steps(24) infinite;
}
@keyframes axis-spin {
from {
transform: translatex(0px);
}
to {
transform: translatex(-123px);
}
}
.globe {
position: absolute;
filter: drop-shadow(-2px -2px 8px #FF409C) drop-shadow(2px 2px 3px #3B2BFF);
}
-->
</div>
</div>
<div class="eight wide column">
<div class="ui grid">
<div class="row">
<div class="column">
<h4 class="ui top attached block header">统计</h4>
<div class="ui bottom attached segment">
<div id="pie_chart_legend"><ul style="list-style: none; padding-left: 20px; margin-top: 0; " class="0-legend"><li style="font-size: 12px; width: 50%; display: inline-block; color: #666; "><span style="width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 5px; background-color: #66dd66; "></span>Accepted</li><li style="font-size: 12px; width: 50%; display: inline-block; color: #666; "><span style="width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 5px; background-color: #ff6384; "></span>Wrong Answer</li><li style="font-size: 12px; width: 50%; display: inline-block; color: #666; "><span style="width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 5px; background-color: darkorchid; "></span>Runtime Error</li><li style="font-size: 12px; width: 50%; display: inline-block; color: #666; "><span style="width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 5px; background-color: #ffce56; "></span>Time Limit Exceeded</li><li style="font-size: 12px; width: 50%; display: inline-block; color: #666; "><span style="width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 5px; background-color: #00b5ad; "></span>Memory Limit Exceeded</li><li style="font-size: 12px; width: 50%; display: inline-block; color: #666; "><span style="width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 5px; background-color: #35a0e8; "></span>Compile Error</li></ul></div>
<div style="width: 260px; height: 260px; margin-left: 33.5px; "><div class="chartjs-size-monitor" style="position: absolute; inset: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;"><div class="chartjs-size-monitor-expand" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="chartjs-size-monitor-shrink" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div></div><canvas style="width: 260px; height: 260px; display: block;" id="pie_chart" width="260" height="260" class="chartjs-render-monitor"></canvas></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
<table class="ui basic table">
<thead>
<tr>
<th>标题</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/article/4823">HTML5语法补充</a></td>
<td>2021-07-28 20:38:13</td>
</tr>
<tr>
<td><a href="/article/4945">关于「头像」</a></td>
<td>2021-08-01 20:32:05</td>
</tr>
<tr>
<td><a href="/article/5098">正大饲料厂的母猪(斐波那契数列)</a></td>
<td>2021-08-12 15:38:54</td>
</tr>
<tr>
<td><a href="/article/5278">关于题目可以用Python做</a></td>
<td>2021-08-17 16:02:34</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
-->
$(function () {
var pie = new Chart(document.getElementById('pie_chart').getContext('2d'), {
aspectRatio: 1,
type: 'pie',
data: {
datasets: [
{
data: [
,
,
,
,
,
,
],
backgroundColor: [
"#66dd66",
"#ff6384",
"darkorchid",
"#ffce56",
"#00b5ad",
"#35a0e8"
]
}
],
labels: [
"Accepted",
"Wrong Answer",
"Runtime Error",
"Time Limit Exceeded",
"Memory Limit Exceeded",
"Compile Error"
]
},
options: {
responsive: true,
legend: {
display: false
},
legendCallback: function (chart) {
var text = [];
text.push(' ');
var data = chart.data;
var datasets = data.datasets;
var labels = data.labels;
if (datasets.length) {
for (var i = 0; i < datasets[0].data.length; ++i) {
text.push('- ');
if (labels[i]) {
text.push(labels[i]);
}
text.push('
');
}
}
text.push(' ');
return text.join('');
}
},
});
document.getElementById('pie_chart_legend').innerHTML = pie.generateLegend();
});
|
321 |
1500 |