結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー RIGIHRIGIH
提出日時 2017-09-05 18:06:56
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 975 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 67,392 KB
実行使用メモリ 24,252 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-24 01:32:35
合計ジャッジ時間 3,318 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
23,304 KB
testcase_01 AC 35 ms
24,120 KB
testcase_02 AC 36 ms
24,252 KB
testcase_03 AC 36 ms
23,460 KB
testcase_04 AC 36 ms
23,580 KB
testcase_05 AC 37 ms
23,736 KB
testcase_06 AC 36 ms
23,580 KB
testcase_07 AC 37 ms
23,580 KB
testcase_08 AC 36 ms
23,688 KB
testcase_09 AC 34 ms
23,304 KB
testcase_10 AC 35 ms
23,964 KB
testcase_11 AC 36 ms
24,024 KB
testcase_12 AC 34 ms
23,328 KB
testcase_13 AC 34 ms
23,340 KB
testcase_14 AC 35 ms
23,400 KB
testcase_15 AC 34 ms
23,964 KB
testcase_16 AC 35 ms
23,424 KB
testcase_17 AC 34 ms
23,316 KB
testcase_18 AC 36 ms
23,676 KB
testcase_19 AC 35 ms
23,688 KB
testcase_20 AC 36 ms
24,036 KB
testcase_21 AC 37 ms
23,952 KB
testcase_22 AC 35 ms
23,592 KB
testcase_23 AC 36 ms
23,316 KB
testcase_24 AC 39 ms
24,060 KB
testcase_25 AC 36 ms
23,604 KB
testcase_26 AC 35 ms
23,400 KB
testcase_27 AC 35 ms
23,388 KB
testcase_28 AC 37 ms
23,952 KB
testcase_29 AC 36 ms
23,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <utility>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define LL long long
#define INF 1000000001
#define mod 1000000007
using namespace std;
int keta(int n,int k){return (n/int(pow(10,double(k-1)))) % 10;} //nの下からk桁目
ll gcd(ll n,ll m){
	if(n<m){ll a=m;m=n;n=a;}
	ll r=n%m;
	while(r!=0){
		n=m;
		m=r;
		r=n%m;
	}
	return m;
}
ll lcm(ll n,ll m){
	return n*m/gcd(n,m);
}

int main(){
	
	int n,k;
	cin>>n>>k;
	int a;
	if((n-1)%(k+1)==0){
		printf("0\n");
		cin>>a;
		int i=1;
		while(a<n){
			printf("%d\n",(k+1)*i);
			i++;
			cin>>a;
		}
		return 0;
	}
	printf("%d\n",(n-1)%(k+1));
	cin>>a;
	int i=1;
	while(a<n){
		printf("%d\n",(n-1)%(k+1)+(k+1)*i);
			i++;
			cin>>a;
	}
	return 0;

}
0