Task: | Pallo |
Sender: | mooc.fi~486604 |
Submission time: | 2022-01-22 16:47:09 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | RUNTIME ERROR | 0.01 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#3 | WRONG ANSWER | 0.01 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:23:9: warning: unused variable 'x' [-Wunused-variable] int x, y, counter, ans; ^ input/code.cpp:23:12: warning: unused variable 'y' [-Wunused-variable] int x, y, counter, ans; ^ input/code.cpp:23:24: warning: unused variable 'ans' [-Wunused-variable] int x, y, counter, ans; ^~~
Code
#include<iostream> #include<bits/stdc++.h> using namespace std; int gcd(int a, int b){ if(b==0) return a; return( gcd(b, a % b)); } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin>>n; int d[n]; vector<pair<int, int>> k; for(int i=0; i<n; i++){ int a,b,c; cin>>a>>b>>c; d[i]=c; k.push_back({a, b}); } int x, y, counter, ans; for(int j=0; j<n; j++){ counter = d[j]; int a = k[j].first; int b= k[j].second; if(b>a) swap(a, b); a-=1; b-=1; int syp =(a/ gcd(a, b))*b; cout<<(counter/(a))+(counter/b)-(counter/(syp-1))<<endl; } }
Test details
Test 1
Group: 1, 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 10 5 76 9 8 78 8 6 49 3 3 94 ... |
correct output |
---|
25 19 15 47 8 ... |
user output |
---|
25 19 15 0 8 ... |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
1000 7 5 99033171167123849 6 8 472883555390027162 9 10 258937093512465880 10 6 691774305483997493 ... |
correct output |
---|
33011057055707949 148620545979722822 57541576336103529 199845910473154830 52151060432923288 ... |
user output |
---|
699559066 699559066 699559066 699559066 699559066 ... Truncated |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000 816332614 86098803 33572721929... |
correct output |
---|
4310587870 45982113074 1550250683 717639357 3282221941 ... |
user output |
---|
25 25 25 25 25 ... Truncated |