QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#650283 | #7858. Basic Equation Solving | Mrlaolu# | WA | 0ms | 3660kb | C++23 | 880b | 2024-10-18 14:26:34 | 2024-10-18 14:26:36 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
using LL = long long;
void solve(){
int a, b, m;
cin >> a >> b >> m;
LL ans = 160 * 2;
if(a > b){
ans += (m / b) * 160LL;
cout << ans << "\n";
return;
}
int last1 = 0, last2 = 0, suc1 = 0, suc2 = 0;
for(int i = 1; i <= m; i ++){
if(!suc2 && i - last2 >= b){
suc2 = 1;
}
if(i - last1 >= a){
ans += 160;
last1 = i;
if(suc2){
ans += 160;
suc2 = 0;
last2 = i;
}
}
}
if(suc2) ans += 160;
cout << ans << "\n";
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int _ = 1;
cin >> _;
while(_--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3660kb
input:
1 P=NP
output:
320
result:
wrong answer 1st lines differ - expected: '766136394', found: '320'