QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#671065#6819. Largest Unique Wins523555337WA 0ms3924kbC++141.3kb2024-10-24 10:33:152024-10-24 10:33:20

Judging History

你现在查看的是最新测评结果

  • [2024-10-24 10:33:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3924kb
  • [2024-10-24 10:33:15]
  • 提交

answer

#include<bits/stdc++.h>

#define int long long
#define x first
#define y second
#define endl '\n'

using namespace std;

const int N=1e6+10,INF=1e14,mod=1e9+7,M=2e5+10;
const double eps = 1e-8;
typedef pair<int,int> PII;
typedef pair<PII,int> PIII;

int gcd(int a,int b){return b?gcd(b,a%b):a;}

int qmi(int a,int k){int res=1;while(k){if(k&1) res=res*a%mod;a=a*a%mod;k>>=1;}return res;}

int exgcd(int a,int b,int &x,int &y){
    if(!b){
        x=1,y=0;
        return a;
    }
    int d=exgcd(b,a%b,y,x);
    y-=a/b*x;
    return d;
}

void slove(){
	int n,m;cin>>n>>m;
	vector<vector<double>>val(n+1,vector<double>(m+1,0));
	if(n==2){
		val[1][m]=1;
		val[2][m]=1;
	}else if(n<=m){
		int no=m;
		for(int i=1;i<=n;i++) val[i][no]=1,no--;
	}
	else {
		int no=m;
		for(int i=1;i<=n;i++){
			if(no)
            {
                val[i][no]=1;
                no--;
            }
            else 
            {
                val[i][m]=1;
            }
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			printf("%.15lf",val[i][j]);
			if(j!=m) cout<<" ";
			else cout<<endl;
		}
	}
}

signed main(){
//	ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
	int T=1;
//	cin>>T;
	while(T--) slove();
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3660kb

input:

2 2

output:

0.000000000000000 1.000000000000000
0.000000000000000 1.000000000000000

result:

ok ok  0.0000 0.0000

Test #2:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

3 3

output:

0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 1.000000000000000 0.000000000000000
1.000000000000000 0.000000000000000 0.000000000000000

result:

ok ok  1.0000 -1.0000 -1.0000

Test #3:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

3 2

output:

0.000000000000000 1.000000000000000
1.000000000000000 0.000000000000000
0.000000000000000 1.000000000000000

result:

ok ok  -1.0000 1.0000 -1.0000

Test #4:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

12 12

output:

0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.0000000000...

result:

ok ok  1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000

Test #5:

score: 0
Accepted
time: 0ms
memory: 3704kb

input:

12 11

output:

0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.0000000000...

result:

ok ok  -1.0000 1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000

Test #6:

score: 0
Accepted
time: 0ms
memory: 3896kb

input:

11 12

output:

0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.0000000000...

result:

ok ok  1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000

Test #7:

score: -100
Wrong Answer
time: 0ms
memory: 3712kb

input:

12 3

output:

0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 1.000000000000000 0.000000000000000
1.000000000000000 0.000000000000000 0.000000000000000
0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 0.000000000000000 1.000000000000000
0.000000000000000 0.0000000000...

result:

wrong answer 3's strategy is not optimal, current = -1.0000000000, better (2) = 0.0000000000