prompt string | response string |
|---|---|
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static double game(int own, int ene, int own_score, int ene_score, ArrayList<Integer> own_hand, ArrayList<Integer> ene_hand, double dp[][][]){
if(own == 0 && ene == 0){
//System.o... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <c... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
using namespace std;
int a[9], b[9], c[9] = { 0,1,2,3,4,5,6,7,8 };
int main() {
int n; cin >> n;
for (int v = 0; v < n; v++) {
for (int i = 0; i < 18; i++) { if (i < 9)cin >> a[i]; else cin >> b[i - 9]; }
int cnt = 0; sort(a, a + 9); sort(b, b + 9);
do {
int c2 = 0;
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
using namespace std;
const int INF = 1000000007;
#define rep(i,n) for(int i=0;i<(int)n;i++)
int aans = 0,bans= 0;
int a[9],b[9];
void rec(int i,int asum,int bsum){
if(i == 9){ // テァツオツづ、ツコツ?ヲツ敖。テ、ツサツカ
if(asum > bsum ) aans++;
els... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
using namespace std;
#define FOR(i,k,n) for(int i=(k); i<(int)n; +... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
vector<int> gate(9), jack(9);
rep(i,9)cin >> gate[i];
rep(i,9)cin >> jack[i];
sort(jack.begin(),jack.end());
int win =... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#defi... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<stack>
#include<climits>
using namespace std;
typedef unsigned long long ll;
int main(){
double C=1;
for(int i=1;i... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int a[9],b[9];
int t;
cin>>t;
while(t--){
double fact9=362880;
int cnt=0;
for(int i=0;i<9;i++)cin>>a[i];
for(int i=0;i<9;i++)cin>>b[i];
sort(b,b+9);
do{
int sa=0,sb=0;
for(int i=0;i<9;i++)(a[i]>b[i]?sa:sb)+=... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>
using name... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<bits/stdc++.h>
using namespace std;
using Int = long long;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
Int a;
cin >> a;
while(a--){
const Int n = 9;
vector<Int> as(n),bs(n);
for(Int i=0;i<n;i++) cin >> as[i];
for(Int i=0;i<n;i++) cin >> bs[i];
sort(as.begin(),as.end());
I... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>
#define f first
#define s second
#define mp make_pair
#define ... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;
int table_4[24][4],table_5[120][5],index_9,m_data[9] = {0,1,2,3,4,5,6,7,8};
int** table_9;
void calc9(){
int select_num = 5,num,loc_... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int n;
cin>>n;
for(int l=0;l<n;l++){
int num[2][9],a[2][9],geitu,jacky;
double winrate1=0,winrate2=0;
for(int j=0;j<2;j++){
for(int k=0;k<9;k++)cin>>a[j][k];
}
for(int z=0;z<9;z++){
num[0][0]=0;
num[1][0]=0;
if(a[0][0]>a[1][z... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int f(int a[],int b[],int c[],int p){
int i;
int m=0,n=0,s=0;
if(p==9){
for(i=0;i<9;i++){
if(a[i]<b[c[i]])
n+=a[i]+b[c[i]];
else
m+=a[i]+b[c[i]];
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
const int N = 9;
int hand1[N];
int hand2[N];
int main(){
int n;
cin >> n;
while(n--){
for(int i=0;i<9;i++){
cin >> hand1[i];
}
for(int i=0;i<9;i++){
cin >> hand2[i];
}
sort(hand1, hand1+N);
int ... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<cstdio>
#define all(c) c.begin(),c.end()
#include<algorithm>
#define MAX 20
#include<vector>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int sum=0;
int M=9*8*7*6*5*4*3*2*1;
vector<int> va(9);
vector<int> vb(9);
for(int i=0;i<9;i++)
cin>>va[i];
for(int i=0;i<9... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<bits/stdc++.h>
using namespace std;
int res,m=9*8*7*6*5*4*3*2;
int a[10],b[10];
bool A[10]={};
void dfs(int index,int L,int R){
if(index==9){
if(L>R)res++;
}
else {
for(int i=0;i<9;i++){
if(A[i])continue;
A[i]=true;
if(a[i] < b[index])dfs(index+1,L+a[i]+b[index],R);
else... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
int main(){
int T;
cin >> T;
while(T--){
array<int, 9> a, b;
REP(i, a.size()) cin >> a[i];
REP(i, b.size()) cin >> b[i];
sort(a.begin(), a.end());
sort(b.begin(), b.end());
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
const int n = 9;
const int time = 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2;
int t;
int a[n], b[n];
cin >> t;
while (t--) {
int sum = 0;
for (int i = 0; i < n; ++i) {
cin >> a[i];
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<stdio.h>
#include<algorithm>
using namespace std;
double dp[10][1<<9][350];
int A[10];int B[10];
double eps=1e-9;
int main(){
int T;scanf("%d",&T);
while(T--){
for(int i=0;i<9;i++)scanf("%d",A+i);
for(int i=0;i<9;i++)scanf("%d",B+i);
for(int i=0;i<10;i++)for(int j=0;j<(1<<9);j++)for(int k=0;k<350;k++)
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numD = sc.nextInt();
int[] gates = new int[9];
int[] jacky = new int[9];
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <cl... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespac... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
constexpr int factorial(int n) {
return n > 1 ? n * factorial(n - 1) : 1;
}
constexpr int NUMBER_OF_CARDS = 9;
constexpr int denominator = factorial(NUMBER_OF_CARDS);
void solve() {
vector<int> gates(NUMBER_OF_CARDS)... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <bits/stdc++.h>
using namespace std;
int gei[10], jac[10];
bool k[10];
int dfs(int num, int a, int b){
int sum=0;
if(num==9){
if(a>b) return 1;
else return 0;
}
for(int i=0; i<9; i++){
if(k[i]) continue;
k[i]=true;
sum+=dfs(num+1, a+(gei[num]>jac[i]? gei... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <algorithm>
using namespace std;
int gates[9];
int jackey[9];
int win() {
int a=0,b=0;
for(int i=0; i<9; ++i) {
if(gates[i] > jackey[i]) a += gates[i]+jackey[i];
else b += gates[i]+jackey[i];
}
return a-b;
}
int main() {
int n;
cin>>n;
while(n-... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
int a[9],b[9];
double sum;
int win;
int pnt;
bool used[9];
void DFS(int len){
if(len==9){
sum+=1;
if(pnt>85){
win++;
}
return;
}
for(int i=0;i<9;i++){
if(used[i]==false){
if(a[len]<b[i]){
pnt+=a[len]+b[i];
}
used[... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(int argc, char *argv[]){
int n;
cin >> n;
for (int d = 0; d < n; d++) {
vector<int> a(9) ,b(9);
for (int i = 0; i < 9; i++) {
cin >> a[i];
}
for (int i = 0; i < 9; i++) {
cin >> b[i]... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int l=0;l<n;l++){
int num[2][9],a[2][9],geitu,jacky;
double winrate1=0,winrate2=0;
for(int j=0;j<2;j++){
for(int k=0;k<9;k++)cin>>a[j][k];
}
for(int z=0;z<9;z++){
num[0][0]=0;
num[1][0]=0;
if(a[0][0]>a[1][z])num[0][0]=(a[0][... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | import java.util.Scanner;
//Card Game
public class Main {
int[] g, j;
boolean[] u;
int res;
void dfs(int k, int pa, int pb) {
int p, q;
if (k == 9) {
if (pb < pa) {
res++;
}
return;
}
for (int i = 0; i < 9; i++) {
if (!u[i]) {
u[i] = true;
if (j[k] < g[i]) {
p = g[i] + j[k];
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <memory>
#include <memory.h>
#include <cmath>
#include <fstream>
#include <cmath>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <ccty... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
void compute(){
int A[9], B[9];
for ( int i = 0; i < 9; i++ ) cin >> A[i];
for ( int i = 0; i < 9; i++ ) cin >> B[i];
sort(A, A + 9);
int w = 0, sum = 0;
do{
int a = 0, b = 0;
for ( int i = 0; i < 9; i++ ){
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | import java.util.Scanner;
//Card Game
public class Main {
int[] a, b;
boolean[] u;
int res;
void dfs(int k, int pa, int pb) {
int p, q;
if (k == 9) {
res += pb < pa ? 1 : 0;
return;
}
for (int i = 0; i < 9; i++) {
if (u[i])
continue;
u[i] = true;
if (b[k] < a[i]) {
p = a[i] + b[k];... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | //Name: Card Game
//Level: 2
//Category: 確率,Probability,全探索
//Note:
/*
* ゲイツの出す手札の順番は固定し、ジャッキーの出し方を全探索する。
*
* オーダーは O(N! ×N)。
*/
#include <iostream>
#include <algorithm>
#include <array>
using namespace std;
void solve() {
array<int,9> as, bs;
for(int i = 0; i < 9; ++i) {
cin >> as[i];
}
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const dou... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <bits/stdc++.h>
using namespace std;
int dp[1<<9][10][200];
int main(){
int q;
cin>>q;
while(q--){
int a[9],b[9];
for(int i=0;i<9;i++)cin>>a[i];
for(int i=0;i<9;i++)cin>>b[i];
memset(dp,0,sizeof(dp));
dp[0][0][0]=1;
for(int i=0;i<(1<<9);i++)
for(int j=0;j<9;j++){
if(__... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
using namespace std;
int p1[9],p2[9];
#define rep(i,n) for(int i=0;i<(int)n;i++)
double ans = 0;
long long dp[9][(1 << 9)][200]={0};
void solve(){
rep(i,9)rep(j,(1<<9))rep(k,200)dp[i][j][k]=0;
rep(j,9){
int state = ( 1 << j);
if ( p1[0]>p2[j]){
dp[0][state][p1[0]+p2[j]]+=1;
}el... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<complex>
#include<iomanip>
using namespace std;
#def... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int n;
cin >> n;
while (n-- > 0) {
vector<int> cards[2];
for (int i = 0; i < 18; i++) {
int temp;
cin >> temp;
if (i < 9) {
card... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<bits/stdc++.h>
#define LL long long
#define REP(i, n) for(int i=0;i<(n);++i)
#define REPA(i, n) for(int i=1;i<(n);++i)
#define lp(i, n) for(int i=-;i<(n);++i)
#define PII pair<int, int>
#define PLL pair<long long, long long>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define DEKAI ((int)1e9+7)
#define A... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | import java.util.Scanner;
import java.util.function.Consumer;
import java.util.stream.IntStream;
public class Main{
static void swap(int a[], int l, int r) {
int tmp = a[l];
a[l] = a[r];
a[r] = tmp;
}
static void perm(int[] a, int loc, int len, Consumer<int[]> f)
{
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <bits/stdc++.h>
using namespace std;
int main(){
int Tc;
int a[9],b[9];
double acnt,bcnt;
cin >> Tc;
while(Tc--){
for(int i = 0 ; i < 9 ; i++){
cin >> a[i];
}
sort(a,a+9);
for(int i = 0 ; i < 9 ; i++){
cin >> b[i];
}
acnt = bcnt = 0;
do{
int aa = 0, b... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int tc; scanf("%d",&tc);
while(tc--){
int a[9],b[9];
for(int i=0;i<9;i++) scanf("%d",a+i);
for(int i=0;i<9;i++) scanf("%d",b+i);
int cnt=0;
sort(a,a+9);
do{
int sum[2]={};
for(int i=0;i<9;i++)
sum[a[i]<b[i]]+=a[i]+b[i]... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int N; cin >> N;
while(N--){
int a[9],b[9];
rep(i,9)cin >> a[i];
rep(i,9)cin >> b[i];
sort(a,a+9),sort(b,b+9);
double c[2] = {0};
do{
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
try {
String packageName = new Main().getClass().getPackage().getName();
System.setIn(new FileInputStream("src/" + packageName + "/input.txt"));
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <math.h>
using namespace std;
int a[9],b[9],Awin,n;
int f(int p[],int q[],int A,int B,int len){
if(len==0&&A>B)Awin++;
int ans=0,r[9],s[9];
for(int i=0;i<len-1;i++)r[i]=p[i+1];
for(int i=0;i<len;i++){
for(int j=0;j<len-1;j++){
if(j<i)s[j... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
vector<vector<int>>flag((4000), vector<int>(1 << 9));
vector<vector<pair<double,double>>>memo((4000),vector<pair<double,double>>(1<<9));
pair<double,double> operator+(const pair<double, double>&... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int gt[9], jk[9], n, s, t, u, v;
while(cin>>n && n){
while(n--){
s = t = 0;
for(int i = 0; i < 9; i++){
cin >> gt[i];
}
for(int j = 0; j < 9; j++){
cin >> jk[j];
}
sort(gt, gt+9);
sort(jk, jk+9);
do{
u... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int gates[10];
int jucky[10];
for(int i = 0; i < 9; i++)
cin>>gates[i];
for(int i = 0; i < 9; i++)
cin>>jucky[i];
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
vector<vector<int>>flag((6000), vector<int>(1 << 9));
vector<vector<pair<double,double>>>memo((6000),vector<pair<double,double>>(1<<9));
pair<double,double> operator+(const pair<double, double>&... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cstring>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);++i)
void solve() {
vector<int> a, b;
REP(i, 9) {int x; scanf("%d", &x); a.push_back(x); }
REP(i, 9) {int x; scanf("%d", &x); b.push_back(x); }
sort(a.begin()... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
using namespace std;
long long int gw=0, jw=0, total=0;
int ag[9], aj[9];
int table[9][9];
bool flag[9];
void dfs(int n, int sum){
if( n==9 ){
total++;
if( sum > 0 ) gw++;
else if( sum < 0 ) jw++;
}
int nn=n+1;
for( int i=0;i<9;i++ ){
if( flag[i] ) continue;
flag[i] = tr... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--) {
int g[9], j[9];
int win = 0;
for(int i=0; i<9; i++) cin>>g[i];
for(int i=0; i<9; i++) cin>>j[i];
sort(j, j+9);
do {
int point = 0;... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace ... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<vector>
#include<iomanip>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
using namespace std;
int main()
{
int T;
while(cin >> T)
{
while(T--)
{
int cards[2][9];
rep(i,2)rep(j,9)cin >> cards[i][j];
sort(c... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#define rep(i,n) for(int i=0;i<n;i++)
#define rp(i,c) rep(i,(c).... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
while(N--){
int G[9], J[9];
for(int i = 0; i < 9; i++) cin >> G[i];
for(int i = 0; i < 9; i++) cin >> J[i];
sort(J, J + 9);
int gwin = 0, jwin = 0;
int cnt = 0;
do {
cnt++;
int gscore = 0, jscore ... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#de... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>
#define f first
#define s second
#define mp make_pair
#define ... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | //00
#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int c[2][9];
for(int i=0;i<2;i++){
for(int j=0;j<9;j++){
cin>>c[i][j];
}
sort(c[i],c[i+1]);
}
int gw=0,jw=0,np=0;
do{
int g=0,j=0;
np++;
... |
Problem: Gates and Jackie, the cats, came up with the rules for a card game played by two people. The rules are as follows.
First, shuffle the cards with the numbers 1 to 18 and deal 9 to each player. Both players issue one card at the same time and get a score based on the value. The player who issues the higher valu... | #include<iostream>
#include<algorithm>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n;
int c[2][9];
int main(){
cin >> n;
while(n--){
const int sum = 171;
rep(i,9)cin >> c[0][i];
rep(i,9)cin >> c[1][i];
int perm[9];
rep(i,9)perm[i] = i;
int win = 0, lo... |
Problem: Problem statement
Find the number of integer sequences $ X_1, X_2, ..., X_N $ that satisfy the following conditions.
1. For any integer $ i $ ($ 1 \ leq i \ leq N $), there exists $ j $ ($ 1 \ leq j \ leq N $) such that $ X_j = i $.
2. $ X_s = t $
3. $ X_ {a_i} <X_ {b_i} $ ($ 1 \ leq i \ leq C $)
Constrain... | #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long int64;
const int MAX_N = 2000 + 1;
const int64 MOD = (int64)(1e9 + 7);
int N, C, target, ord;
int parent[MAX_N+1];
vector<int> graph[MAX_N+1];
int V[MAX_N+1];
int S[MAX_N+1];
int64 T[MAX_N+1];
int64 ... |
Problem: Problem statement
Find the number of integer sequences $ X_1, X_2, ..., X_N $ that satisfy the following conditions.
1. For any integer $ i $ ($ 1 \ leq i \ leq N $), there exists $ j $ ($ 1 \ leq j \ leq N $) such that $ X_j = i $.
2. $ X_s = t $
3. $ X_ {a_i} <X_ {b_i} $ ($ 1 \ leq i \ leq C $)
Constrain... | #include<iostream>
#include<cassert>
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
const ll mod = 1e9 + 7;
const int N = 2010;
//loop finding begin
vector<int> loopedge[N];
int loopv... |
Problem: Problem statement
Find the number of integer sequences $ X_1, X_2, ..., X_N $ that satisfy the following conditions.
1. For any integer $ i $ ($ 1 \ leq i \ leq N $), there exists $ j $ ($ 1 \ leq j \ leq N $) such that $ X_j = i $.
2. $ X_s = t $
3. $ X_ {a_i} <X_ {b_i} $ ($ 1 \ leq i \ leq C $)
Constrain... | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const dou... |
Problem: Problem statement
Find the number of integer sequences $ X_1, X_2, ..., X_N $ that satisfy the following conditions.
1. For any integer $ i $ ($ 1 \ leq i \ leq N $), there exists $ j $ ($ 1 \ leq j \ leq N $) such that $ X_j = i $.
2. $ X_s = t $
3. $ X_ {a_i} <X_ {b_i} $ ($ 1 \ leq i \ leq C $)
Constrain... | #include<iostream>
#include<cassert>
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
const ll mod = 1e9 + 7;
const int N = 2010;
//loop finding begin
vector<int> loopedge[N];
int loopv... |
Problem: Problem statement
Find the number of integer sequences $ X_1, X_2, ..., X_N $ that satisfy the following conditions.
1. For any integer $ i $ ($ 1 \ leq i \ leq N $), there exists $ j $ ($ 1 \ leq j \ leq N $) such that $ X_j = i $.
2. $ X_s = t $
3. $ X_ {a_i} <X_ {b_i} $ ($ 1 \ leq i \ leq C $)
Constrain... | #include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fr(i,c) for(__typeof(c.begin()) i=c.begi... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#d... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | A=0
n=str(input())
if len(n)>=6:
A=A+1
B=n.count('0')+n.count('1')+n.count('2')+n.count('3')+n.count('4')+n.count('5')+n.count('6')+n.count('7')+n.count('8')+n.count('9')
if B>0:
A=A+1
C=n.count('a')+n.count('b')+n.count('c')+n.count('d')+n.count('e')+n.count('f')+n.count('g')+n.count('h')+n.count('i')+n.count(... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
void invalid(){
cout << "INVALID" << endl;
}
int main() {
string s;
cin >> s;
if (s.length() < 6){
invalid();
return 0;
}
bool checkUpper = false, checkLower = false, checkDigit = false;
for (int i = 0; i < s.length(); ++i)... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
bool f = true;
if(s.length() < 6) f = false;
if(any_of(begin(s), end(s), [](char c) { return isdigit(c); }) == false) f = false;
if(any_of(begin(s), end(s), [](char c) { return isupper(c); }) == false) f = false;
if(... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main(){
string s;
bool a=false, b=false, c=false;
cin>>s;
for(char i:s){
if(isdigit(i)) a=true;
if(islower(i)) b=true;
if(isupper(i)) c=true;
}
if(!(s.size()>5&&a&&b&&c))cout<<"IN";
cout<... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<string>
using namespace std;
bool hantei(string T) {
if (T.size() < 6) { return false; }
int a = 0, b = 0, c = 0;
for (int i = 0; i < T.size(); i++) {
if (isdigit(T[i])) { a++; }
if (islower(T[i])) { b++; }
if (isupper(T[i])) { c++; }
}
if (a == 0) { return false; }
if (b == 0) ... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
bool ok = true, num = false, up = false, low = false;
cin >> s;
ok &= s.size() >= 6;
for(auto c : s){
num |= c >= '0' && c <= '9';
low |= c >= 'a' && c <= 'z';
up |= c >= 'A' && c <= 'Z';
}
ok &= nu... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<cctype>
#include<cstring>
using namespace std;
int main()
{
char line[20];
int x, y, i;
x = 0;
y = 0;
cin >> line;
if( strlen(line) >= 6 )
{
x = strlen(line);
for ( i = 0; i < x; i++)
{
if( isdigit(line[i]) != 0)
{
y++;
}
}
if( y != 0)
{
y = 0;
for ( i =... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void){
int i, jd[4] = {0,0,0,0};
char s[100000];
scanf("%s",s);
for(i = 0;i < strlen(s);i++){
if(isdigit(s[i])){
jd[1] = 1;
}else if(isupper(s[i])){
jd[2] = 1;
}else if(islower(s[i])){
jd[3] = 1;
}
}
if(str... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<string>
using namespace std;
int main(){
int length=0, num=0, big=0, small=0;
string str;
cin >> str;
if(str.size() >= 6) length++;
for(int i = 0; i < str.size(); i++){
if(str[i] >= '0' && str[i] <= '9') num++;
else if(str[i] >= 'a' && str[i] <= 'z') small++;
else if(str[i] >=... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<cctype>
using namespace std;
int main(){
bool len,d,l,u;
string s;
cin >> s;
len = (s.size()<6)?false:true;
d = l = u = false;
for(int i=0;i<s.size();i++){
if(isdigit(s[i]))d = true;
if(islower(s[i]))l = true;
if(isupper(s[i]))u = true;
}
if(len && d && l &... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<stdio.h>
#include<string.h>
using namespace std;
int main(){
char s[21];
int a[3]={};
scanf("%s",s);
if(strlen(s)<6) printf("INVALID\n");
else {
for(int i=0;i<strlen(s);i++){
if(s[i]>='0'&&s[i]<='9'&&a[0]==0)a[0]++;
if(s[i]>='A'&&s[i]<='Z'&&a[1]==0)a[1]++;
if(s[i]>='a'&&s[i]<='z... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int main() {
string s;cin>>s;
bool nu=false,ca=false,sm=false;
for(char c:s){
if('0'<=c&&c<='9')nu=true;
if('a'<=c&&c<='z')sm=true;
if('A'<=c&&c<='Z')ca=true;
}
if(nu&&sm&&ca&&s.size()>=6)puts("VALID");
else puts("INVALID");
... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | x=input()
a=0
b=0
c=0
if len(x)<6:
print("INVALID")
else:
for i in range(len(x)):
X=ord(x[i])
if 48<=X and X<=57:
a+=1
if 97<=X and X<=122:
b+=1
if 65<=X and X<=90:
c+=1
if a==0 or b==0 or c==0:
print("INVALID")
else:
pr... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 999999999;
const in... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <string>
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
using namespace std;
typedef long long ll;
bool check(string s){
if(s.size() < 6) return false;
bool a = false, A = false, num = false;
rep(i, s.size()){
if('a' <= s[i] &&... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecisio... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<string>
#include<vector>
#include <cctype>
using namespace std;
int main(void){
string w;
char c;
cin>>w;
bool ans=true;
if(w.size()<6)ans=false;
int t=0;
for(int i=0;i<w.size();i++){
c=w[i];
if (std::isdigit(static_cast<unsigned char>(c)))t++;
}
if(t==0)ans=false;
t=0;
for(int i=0;i<w.siz... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | def length(s):
return False if len(s)<6 else True
def inNum(s):
for c in s:
if c.isdigit():
return True
return False
def inUpper(s):
for c in s:
if c.isupper():
return True
return False
def inLower(s):
for c in s:
if c.islower():
ret... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | import java.io.*;
import java.util.*;
/**
* AIZU ONLINE JUDGE
* 2522
* 2020/5/6
*/
public class Main {
boolean main() throws IOException {
Scanner sc = new Scanner(systemin);
String s = sc.nextLine();
boolean valid = false;
if (s.length() < 6) {
... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <string>
using namespace std;
bool check_pass(string str) {
if (str.length() < 6) {
return false;
}
bool small,large,num;
small = large = num = false;
for (int i = 0; i < str.length(); ++i) {
if (str[i] >= 'a' && str[i] <= 'z') {
small = true;
}
if (str[i] >= 'A' && str[i]... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <cstring>
using namespace std;
int main(){
string str;
int lenstr=0,number=0,big=0,small=0;
int temp=0;
cin>>str;
if(str.size()>=6)
lenstr=1;
if(temp>=6)
lenstr=1;
for(int i=0;i<str.size();i++){
if('0'<=str[i] && str[i]<='9')
number=1;
if ('a'<... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<cstdio>
#include<string>
#include<ctype.h>
using namespace std;
int main(){
string a;
int b=0,c=0,d=0;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]-'0'>=0&&a[i]-'0'<=9)b++;
if(isupper(a[i]))c++;
if(islower(a[i]))d++;
}
if(b==0||c==0||d==0||a.size()<6)printf("IN");
p... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
string str;
cin >> str;
if(str.length()<6){
cout << "INVALID" << endl;
return 0;
}
vector<bool> flag(3,false);
for(int i=0;i<str.length();i++){
if(str[i]>='0' && str[i]<='9'){
... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <string>
using namespace std;
void solve()
{
string s;
cin >> s;
if(s.size() < 6)
{
cout << "INVALID" << endl;
return;
}
bool num_flag = false;
bool capital_flag = false;
bool small_flag = false;
for(int i = 0; i < s.size(); ++i)
{
if('0' <= s[i] && s[i] <= '9')
{
num... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<int,int>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lowe... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String input = sc.next();
boolean ... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin>>s;
int flag=1;
int tmp;
if(s.size()<6)flag=0;
tmp=1;
for(int i=0;i<s.size();i++){
if('0'<=s[i] && s[i]<='9')tmp=0;
}
if(tmp)flag=0;
tmp=1;
for(int i=0;i<s.size();i++){
if('a'<=s[i] && s[i]<='z')tmp=0;
}
if(t... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | // テ・ツ淞コテヲツ慊ャテ」ツδ?」ツδウテ」ツδ療」ツδャテ」ツδシテ」ツδ?(テァツクツョテ・ツーツ湘ァツ可?
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long
template<typename T> void chmax(... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
using namespace std; ... |
Problem: It is important to use strong passwords to make the Internet more secure. At the same time, it is very important not to reuse the same password. No matter how strong your password is, if the plaintext is leaked in one place, it will be very easy to break. Of course, if all applications hash passwords and use S... | #include<iostream>
#include<string>
using namespace std;
int main() {
string s; cin >> s;
if (s.size() <= 5)cout << "INVALID\n";
else{
bool n = false, c = false, sm = false;
for (int i = 0; i < s.size(); i++){
if (s[i] == '0')n = true; else if (s[i] == '1')n = true;
else if (s[i] == '2')n = true; else if (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.