QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#131833#5128. Dividing DNA PetroTarnavskyi#WA 1ms3520kbC++17770b2023-07-28 15:07:222023-07-28 15:07:25

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-28 15:07:25]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3520kb
  • [2023-07-28 15:07:22]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FILL(a, b) memset(a, b, sizeof(a))

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;





int main()
{
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	
	int n;
	cin >> n;
	int ans = 0;
	int prev = 0;
	FOR(i, 0, n){
		cout << "? " << prev + 1 << " " << i + 1 << endl;
		string s;
		cin >> s;
		if(s == "absent"){
			prev = i + 1;
			ans++;
		}
	}
	cout << "! " << ans << endl;
	


	
	
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3520kb

input:

1

output:

? 1 1

result:

wrong answer l must be non-empty