QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275875 | #5259. Skills in Pills | wangqingxian | WA | 0ms | 3704kb | C++14 | 1.2kb | 2023-12-05 10:37:30 | 2023-12-05 10:37:30 |
Judging History
answer
#include<algorithm>
#include<vector>
#include<cstdio>
#include<map>
#include<cstring>
#include<iostream>
#include<cstdlib>
#include<iomanip>
#include<bitset>
#include<queue>
#include<cassert>
#include<stdlib.h>
#include<cmath>
#include<set>
//#define ll long long
#define ld long double
#define For(i,l,r) for(int i=(l);i<=(r);i++)
#define rof(i,r,l) for(int i=(r);i>=(l);i--)
#define db double
#define mem0(a) memset(a,0,sizeof(a))
#define ull unsigned long long
#define lowbit(t) (t&-t)
#define uint unsigned int
#define int long long
#define x1 alkjhfasdlkjfawlkf
#define x2 fsdouifiaojlfkwewj
#define y1 sdlkajfaskljfiowfw
#define y2 ajlfioueuoijwefoja
using namespace std;
const int N=1e6+10,inf=0x7fffffff,mod=998244353;
int k1,k2,n;
int ans=0;
bool f=1;
int bk=0;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>k1>>k2>>n;
ans=n/k2;
for(int i=k1;i<=n;i+=k1){
if((i%k2-bk+k2)%k2==0){
if(f){
i--;
f=0;
}
else{
bk++;
f=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: 0ms
memory: 3704kb
input:
3 9 20
output:
9
result:
wrong answer 1st lines differ - expected: '8', found: '9'