/ SB域 /

记录详情

Time Exceeded

/in/foo.cc: In function 'int main()':
/in/foo.cc:24:35: warning: statement has no effect [-Wunused-value]
   24 |                         if(k==0) k==n;
      |                                  ~^~~
# 状态 耗时 内存占用
#1 Time Exceeded ≥1002ms ≥480.0 KiB
#2 Time Exceeded ≥1001ms ≥324.0 KiB
#3 Accepted 2ms 532.0 KiB
#4 Accepted 2ms 472.0 KiB
#5 Accepted 2ms 528.0 KiB
#6 Accepted 2ms 532.0 KiB
#7 Accepted 2ms 468.0 KiB
#8 Time Exceeded ≥1004ms ≥500.0 KiB
#9 Accepted 2ms 476.0 KiB
#10 Accepted 2ms 420.0 KiB

代码

#include<bits/stdc++.h>
using namespace std;
int a[1000];
int main()
{
	int n,z,m;
	cin>>n>>z>>m;
	for(int i=1;i<=m;i++){
		int x;
		cin>>x;
		a[x]=1;
	}
	for(int i=1;i<=n;i++){
		int k=1;
		while(1){
			if(a[k]==1){
				break;
			}
			if(k==z&&a[z]!=1){
				cout<<i;
				return 0;
			}
			k=(k+i)%n;
			if(k==0) k==n;
		}
	}
	return 0;
} 

信息

递交者
类型
递交
题目
桐桐的跳棋游戏
题目数据
下载
语言
C++
递交时间
2025-02-15 12:56:54
评测时间
2025-02-15 12:56:54
评测机
分数
70
总耗时
≥3024ms
峰值内存
≥532.0 KiB