Also, it is possible to solve odd number version. (How many ways to fill all the empty cells with 'x' or 'o' (each cell must contain only one character in the end) are there, such that for each cell the number of adjacent cells with 'o' will be "odd"? ) I'll hope for your...
Meta Hacker Cup Round 1 starts on Saturday, October 7th at 10:00 AM Pacific in under 48 hours! Anyone can register for Round 1 this year, even if you haven't participated in the practice round. Important info: To qualify for Round 2, you must solve at least one problem in this ...
Status:No Solve Evaluate:Hard 显然:0和1出现的次数如果是奇数那么一定无解 对于剩下的情况,注意到如下的观察: 观察: 我们定义第\(2i-1\)位和第\(2i\)位的字符构成一个“字符组”(\(i\in[1,n]\)),那么通过一次轮转操作,我们一定能使得原串中只含有字符组00和11,下述操作方法: 以字符串000110111001...
ONLY aliens can solve it! → Reply JanBobi 11 months ago, # | 0 Why we can't see the code from other's submissions? → Reply _tudor_costin_ 11 months ago, # | 0 I just noticed, the mine in problem C is written in bold, foreshadowing the minesweeper problem, amazing ...
voidsolve(){longlongsum =0;in(n) ;for(inti =1; i <= n; ++i) {longlongx ;in(x),sum += x ; }constlonglongvalue1 = sum % n,value2 = n - value1 ;out('\n',value1 * value2) ; } C. Need for Pink SlipsC. Need for Pink Slips ...
leetcode-rust package require rustc_private feature to enable rustc relative APIe.g. use rustc_span::lev_distance::lev_distance(&a, &b) one line to solve leetcode edit-distance (Unfortunately we can't use nightly and rustc-dev in leetcode)...
void solve() { in(a,b) ; if (a == b) return out(' ',0,0),fastio::putc('\n'),void(); if (a < b) std::swap(a,b) ; c = a - b ; out(' ',c,min(b % c,c - b % c)) ; fastio::putc('\n') ; }
#include<cstdio>#include<cstring>#defineLLlonglongLLsolve(LL a,LL b){if(b==1)returna;if(a%b==0)returna/b;//開始忘了考虑整除。RE on test #7returnsolve(b,a%b)+(a/b);}intmain(){// freopen("in.txt", "r", stdin);LL a,b;while(scanf("%lld%lld",&a,&b)==2){printf(...
#include<cstdio>#include<cstring>#defineLLlong longLLsolve(LLa,LLb){if(b==1)returna;if(a%b==0)returna/b;//開始忘了考虑整除。RE on test #7returnsolve(b,a%b)+(a/b);}intmain(){// freopen("in.txt", "r", stdin);LLa,b;while(scanf("%lld%lld",&a,&b)==2){printf("%lld...
leetcode-rust package require rustc_private feature to enable rustc relative APIe.g. use rustc_span::lev_distance::lev_distance(&a, &b) one line to solve leetcode edit-distance (Unfortunately we can't use nightly and rustc-dev in leetcode)...