submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s790357674 | p03965 | C++ | // C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map... | /tmp/ccDeEBv6.o: in function `dp(long long, long long)':
a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccDeEBv6.o
a.cc:(.text+0x1c0): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccDeEBv6.o
a.cc:(.text+0... |
s491479117 | p03965 | C++ | // C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map... | /tmp/ccZGelT2.o: in function `dp(long long, long long)':
a.cc:(.text+0x244): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccZGelT2.o
a.cc:(.text+0x295): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccZGelT2.o
a.cc:(.text+0... |
s776169144 | p03965 | C++ | #include <algorithm>//min/max/sort(rand-access it)/merge
#include <array>
#include <bitset>
#include <climits>//INT_MAX/INT_MIN/ULLONG_MAX
#include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/round/trunc
#include <cstdlib>//abs/atof/atoi/atol/atoll/strtod/strtof/..., srand/rand, calloc... | a.cc: In function 'int main()':
a.cc:55:12: error: 's' was not declared in this scope
55 | cin >> s;
| ^
|
s495919971 | p03965 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(void){
string source;
cin >> source;
int score = 0;
for(int i = 0; i < source.size(); i++){
if(i < source.size / 2){
if(source[i] == 'p')score--;
else score++;
}else{
if(source[i] == 'g')score++;
}
}
cout << s... | a.cc: In function 'int main()':
a.cc:10:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s225994884 | p03965 | C | #include <stdio.h>
int main() {
char s[1e6];
int g = 0, p = 0;
scanf("%s", s);
while (*(++s)) {
if (*s == 'g') {
g++;
} else {
p++;
}
}
printf("%d\n", g - p >> 1);
return 0;
} | main.c: In function 'main':
main.c:3:10: error: size of array 's' has non-integer type
3 | char s[1e6];
| ^
main.c:6:14: error: lvalue required as increment operand
6 | while (*(++s)) {
| ^~
|
s857960751 | p03965 | C | #include <stdio.h>
int main() {
char c;
int g = 0, p = 0;
while (c = getc(STDIN)) {
if (c == 'g') {
g++;
} else {
p++;
}
}
printf("%d\n", g - p >> 1);
return 0;
} | main.c: In function 'main':
main.c:5:21: error: 'STDIN' undeclared (first use in this function)
5 | while (c = getc(STDIN)) {
| ^~~~~
main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
|
s173641854 | p03965 | C | #include <stdio.h>
int main() {
char c;
int g = 0, p = 0;
while (c = getc()) {
if (c == 'g') {
g++;
} else {
p++;
}
}
printf("%d\n", g - p >> 1);
return 0;
} | main.c: In function 'main':
main.c:5:16: error: too few arguments to function 'getc'
5 | while (c = getc()) {
| ^~~~
In file included from main.c:1:
/usr/include/stdio.h:576:12: note: declared here
576 | extern int getc (FILE *__stream) __nonnull ((1));
| ^~~~
|
s259927735 | p03965 | C | #include <stdio.h>
int main() {
char c;
while (c = getc()) {
if (c == 'g') {
g++;
} else {
p++;
}
}
printf("%d\n", g - p >> 1);
return 0;
} | main.c: In function 'main':
main.c:4:16: error: too few arguments to function 'getc'
4 | while (c = getc()) {
| ^~~~
In file included from main.c:1:
/usr/include/stdio.h:576:12: note: declared here
576 | extern int getc (FILE *__stream) __nonnull ((1));
| ^~~~
main.c:6:13... |
s385680098 | p03965 | C | #include <stdio.h>
int main(void)
{
int i,gc,pc,score;
char[100000] code;
scanf("%s",&code);
for(i=0;code[i]!='\0';i++)
{
if(code[i] == 'g')
{
pc++;
score++;
}
else if(code[i] == 'p')
{
gc++;
score++;
}
if(gc>pc)
{
score--;
}
else if(pc>gc)
{
score--;
}
}
printf("... | main.c: In function 'main':
main.c:6:13: error: expected identifier or '(' before '[' token
6 | char[100000] code;
| ^
main.c:8:21: error: 'code' undeclared (first use in this function)
8 | scanf("%s",&code);
| ^~~~
main.c:8:21: note: each undeclared i... |
s233368417 | p03965 | C | #include<stdio.h>
int main(){
char s[100001];
scanf("%s",s);
int g=0;
int p=0;
int score=0;
int i=0;
while(s[i]!='\0'){
if(s[i]=='g'){
if(p<g){
p++;
score++;
}
else{
g++;
}
}
... | main.c: In function 'main':
main.c:35:5: error: expected declaration or statement at end of input
35 | return 0;
| ^~~~~~
|
s964287299 | p03966 | Java | import java.util.Scanner;
public class Main {
static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
int N=gi();
long[] T=new long[N];
long[] A=new long[N];
for (int i=0; i<N; i++) {
T[i]=gl();
A[i]=gl();
}
... | Main.java:27: error: '.class' expected
System.out.println((long(ht+ha));
^
Main.java:27: error: not a statement
System.out.println((long(ht+ha));
^
Main.java:27: error: ';' expected
System.out.println((long(ht+ha));
... |
s325969655 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
long long n,t[1005],a[1005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n;
for(long long i=0;i<n;i++)
cin>>t[i]>>a[i];
for(long long i=1;i<n;i++)
{
long long d=max(t[i-1]/t[i],a[i-1])/a[i]);
... | a.cc: In function 'int main()':
a.cc:16:49: error: expected ',' or ';' before ')' token
16 | long long d=max(t[i-1]/t[i],a[i-1])/a[i]);
| ^
|
s167945519 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
long long n,t[1005],a[1005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n;
for(long long i=0;i<n;i++)
cin>>t[i]>>a[i];
for(long long i=1;i<n;i++)
{
long long d=max(t[i-1])/t[i],a[i-1])/a[i]);
... | a.cc: In function 'int main()':
a.cc:16:24: error: no matching function for call to 'max(long long int&)'
16 | long long d=max(t[i-1])/t[i],a[i-1])/a[i]);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14... |
s387275769 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
long long n,t[1005],a[1005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n;
for(long long i=0;i<n;i++)
cin>>t[i]>>a[i];
for(long long i=1;i<n;i++)
{
long long d=max((t[i-1])/t[i],a[i-1])/a[i]);
... | a.cc: In function 'int main()':
a.cc:16:51: error: expected ',' or ';' before ')' token
16 | long long d=max((t[i-1])/t[i],a[i-1])/a[i]);
| ^
|
s878380552 | p03966 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long N, T, A;
cin >> N >> T >> A;
for (int i = 1; i < N; i++) {
long double t, a;
cin >> t >> a;
if (T * a > A * t) {
T = t * ceil((long double)T / t);
A = a * ceil((long double)T / t);
}
else {
T = t * ceil((long do... | a.cc: In function 'int main()':
a.cc:12:33: error: 'ceil' was not declared in this scope
12 | T = t * ceil((long double)T / t);
| ^~~~
a.cc:16:33: error: 'ceil' was not declared in this scope
16 | T = t * ceil((long double)A / a... |
s715895056 | p03966 | C++ | #include<bits/stdc++.h>
using namespace std;
deque < int > a;
deque < int > b;
int ans=1;
int gcd(int a2,int b2)
{
while(a2%b2!=0)
{
a2=b2;
b2=a2%b2;
}
return a2;
}
int main()
{
int n;
cin>>n;
int a2,b2;
for(int i=0;i<n;i++)
{
cin>>a2>>b2;
a.push_back(a2);
b.push_back(b2);
}
ans+=(a[0]+b[0]);
for(... | a.cc: In function 'int main()':
a.cc:39:25: error: expected primary-expression before '}' token
39 | }
| ^
a.cc:41:23: error: 'j' was not declared in this scope
41 | ans+=(j+j2);
| ^
a.cc:41:25: error: 'j2' was not d... |
s840414112 | p03966 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 500030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin... | a.cc: In function 'int main()':
a.cc:33:37: error: 'aa' was not declared in this scope; did you mean 'a'?
33 | ll z=max(bb,aa);
| ^~
| a
|
s056388004 | p03966 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
ll CEIL(ll x, ll y) {
ll ans=x/y;
if (x % y == 0)return ans;
else return ans +... | a.cc: In function 'int main()':
a.cc:24:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
24 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s517820454 | p03966 | C++ | #include <iostream>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for (int i = n - 1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (i... | a.cc:22:16: error: 'boost' has not been declared
22 | namespace mp = boost::multiprecision;
| ^~~~~
a.cc:22:23: error: 'multiprecision' is not a namespace-name
22 | namespace mp = boost::multiprecision;
| ^~~~~~~~~~~~~~
|
s511631275 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define Abs(x)((x) < 0 ? (x) * -1 : (x))
#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y... | a.cc: In function 'int main()':
a.cc:193:32: error: no matching function for call to 'max(int, const long long int&)'
193 | j = max(1, max(x / t, y / a));
| ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from... |
s986405549 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
long long curA, curT, A, T;
int n;
int main() {
scanf("%d", &n);
scanf("%lld%lld", &curT, &curA);
for(int i = 1; i < n; i++) {
scanf("%lld%lld", &T, &A);
if(T <#include <bits/stdc++.h>
using namespace std;
long long curA, curT, A, T;
int n;
i... | a.cc:12:15: error: stray '#' in program
12 | if(T <#include <bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:12:16: error: 'include' was not declared in this scope
12 | if(T <#include <bits/stdc++.h>
| ^~~~~~~
a.cc:12:25: error: 'bits' was not decla... |
s331113121 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
__int128_t n;
cin>>n;
vector<__int128_t> t(n);
vector<__int128_t> a(n);
for(int i=0;i<n;i++){
cin>>t.at(i);
cin>>a.at(i);
}
__int128_t T=t.at(0),A=a.at(0);
for(int i=0;i<n;i++){
if(T*a.at(i)<A*t.at(i)){
if(A%a.at(i)==0){
... | a.cc: In function 'int main()':
a.cc:6:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__int128')
6 | cin>>n;
| ~~~^~~
| | |
| | __int128
| std::istream {aka std::basic_istream<char>}
In file included from /usr/inclu... |
s679125258 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
int main() {
mp::cpp_int n;
cin>>n;
vector<mp::cpp_int> t(n);
vector<mp::cpp_int> a(n);
for(int i=0;i<n;i++){
cin>>t.at(i);
cin>>a.at(i);
}
mp::cpp_int T=t.at(0),A=a.at(0... | a.cc:3:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
3 | #include <boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s118018880 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
int main() {
mp:cpp_int n;
cin>>n;
vector<mp::cpp_int> t(n);
vector<mp::cpp_int> a(n);
for(int i=0;i<n;i++){
cin>>t.at(i);
cin>>a.at(i);
}
mp:cpp_int T=t.at(0),A=a.at(0);... | a.cc:3:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
3 | #include <boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s379692667 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;int maiint main() {
mp:cpp_int n;
cin>>n;
vector<mp::cpp_int> t(n);
vector<mp::cpp_int> a(n);
for(int i=0;i<n;i++){
cin>>t.at(i);
cin>>a.at(i);
}
mp:cpp_int T=t.at(0),A=a.... | a.cc:3:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
3 | #include <boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s160458356 | p03966 | C | #include <stdio.h>
int main(){
int n,ans=1,p;
scanf("%d",&n);
int t[n+1],a[n+1];
for(int i=1;i<=n;i++) scanf("%d %d",&t[i],&a[i]);
for(int i=1;i<=n;i++){
p=0;
for(j=1;j>=0;j++){
p+=t[i]+a[i];
if(p>=ans) break;
}
}
printf("%d",ans);
return 0;
} | main.c: In function 'main':
main.c:12:9: error: 'j' undeclared (first use in this function)
12 | for(j=1;j>=0;j++){
| ^
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
|
s908972189 | p03966 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long[] T = new long[N];
long[] A = new long[N];
for( int i=0; i<N; i++ ){
T[i] = sc.nextLong();
A[i] = sc.nextLong();
}
for( int i=1; i<N; i++ ){
if( T[i]<T[... | Main.java:16: error: ')' expected
for( long j=a; j<(a+2; j++ ){
^
1 error
|
s266831868 | p03966 | Java | import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long[][] T = new long[3][N];
for(int i = 0; i < N; i++){
T[0][i] = sc.nextLong();
T[1][i] = sc.nextLong();
... | Main.java:29: error: cannot find symbol
min = Math.max(t, a);
^
symbol: variable min
location: class Main
Main.java:30: error: cannot find symbol
numT = min*T[0][i];
^
symbol: variable min
location: class Main
Main.java:31: error: cannot find symbol
... |
s369097091 | p03966 | C++ | #include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
int main() {
int n; cin >> n;
double a=1.0d;
double t=1.0d;
repi(i,0,n){
double ttmp, atmp;
cin >> ttmp >> atmp;
double x = max(... | a.cc: In function 'int main()':
a.cc:15:45: error: 'seil' was not declared in this scope; did you mean 'ceil'?
15 | double x = max(ceil(t/ttmp),seil(a/atmp));
| ^~~~
| ceil
|
s087408506 | p03966 | C++ | 5
3 10
48 17
31 199
231 23
3 2 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5
| ^
|
s535211967 | p03966 | C++ | #include<bits/stdc++.h>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
template < typename T > std::string to_string( const T& n )
{
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
using namespace std;
const long long INF=9000000000000000;
int main(){
long long n,a=0,b=0;
cin>>... | a.cc: In function 'int main()':
a.cc:25:49: error: expected ')' before ';' token
25 | for(int i=2;i<=max(a/num[i*2],b/num[i*2+1];i++){
| ~ ^
| )
|
s478410202 | p03966 | C++ | #include<bits/stdc++.h>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
template < typename T > std::string to_string( const T& n )
{
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
using namespace std;
const long long INF=9000000000000000;
int main(){
long long n,a=0,b=0;
cin>>... | a.cc: In function 'int main()':
a.cc:25:38: error: invalid operands of types 'long long int' and 'long long int [(n * 2)]' to binary 'operator/'
25 | for(int i=1;i<=max(a/num[i*2],b/num
| ~^~~~
| | |
| ... |
s238238716 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long INF = 1LL << 60;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int ... | a.cc: In function 'int main()':
a.cc:20:27: error: no matching function for call to 'chmax(long long int&, int)'
20 | if (T.at(i) < t) chmax(p, divCeil(t, T.at(i)));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:25: note: candidate: 'template<class T> bool chmax(T&, T)'
6 | template <clas... |
s953327894 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define debug(x) cerr<<#x<<" "<<x<<endl;
signed main() {
int n;cin>>n;
int s,t;
cin>>s>>t;
for(int i=0;i<n-1;++i){
int tmp = max((s+p-1)/p, (t+q-1)/q);
s=tmp*p;
t=tmp*q;
}
cout<<s+t<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:22: error: 'p' was not declared in this scope
12 | int tmp = max((s+p-1)/p, (t+q-1)/q);
| ^
a.cc:12:33: error: 'q' was not declared in this scope
12 | int tmp = max((s+p-1)/p, (t+q-1)/q);
| ^
|
s710477504 | p03966 | C++ | #include <bits/stdc++.h>
// statics
using namespace std;
using int64 = long long;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;
// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(... | a.cc: In function 'int main()':
a.cc:83:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
83 | OUT(ans)BR;
| ^~~
a.cc:20:26: note: in definition of macro 'OUT'
20 | #define OUT(dist) cout<<(dist);
| ^~~~
|
s941583283 | p03966 | C++ | #include <bits/stdc++.h>
// statics
using namespace std;
using int64 = long long;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;
// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(... | a.cc: In function 'int main()':
a.cc:68:9: error: redeclaration of 'int64 sss'
68 | int sss = tmp;
| ^~~
a.cc:58:9: note: 'int64 sss' previously declared here
58 | int sss = tmp;
| ^~~
a.cc:83:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
83 | OUT(ans... |
s024971000 | p03966 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
using namespace std;
typedef long long ll;
tem... | a.cc: In function 'int main()':
a.cc:34:7: error: 'k1' was not declared in this scope; did you mean 'y1'?
34 | k1=aa/a;
| ^~
| y1
a.cc:35:7: error: 'k2' was not declared in this scope
35 | k2=bb/b;
| ^~
|
s198044452 | p03966 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in);) {
new Main().solve(sc);
}
}
void solve(Scanner sc) {
int n = sc.nextInt();
double numOfT = 1;
double numOfA = 1;
for... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s972097370 | p03966 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>
using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#de... | a.cc: In function 'int main()':
a.cc:99:33: error: 'rsl2' was not declared in this scope; did you mean 'rsl1'?
99 | rsl2 = x + y;
| ^~~~
| rsl1
a.cc:102:35: error: 'rsl2' was not declared in this scope; did yo... |
s284156512 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef __int128 int64;
long long n, A[1005], B[1005];
int64 extended_euclid(int64 a, int64 b, int64 &x, int64 &y) {
int64 xx = y = 0;
int64 yy = x = 1;
while (b) {
int64 q = a / b;
int64 t = b; b = a%b; a = t;
t = xx; xx = x - q*xx; x = t;
t = yy; yy = y - q*y... | a.cc: In function 'int64 down(int64, int64)':
a.cc:26:15: error: call of overloaded 'abs(int64&)' is ambiguous
26 | if(abs(a) % abs(b))
| ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
... |
s429119676 | p03966 | C++ | #include<bits\stdc++.h>
using namespace std;
#define ll long long
#define lf double
#define N 4
#define err {puts("-1");exit(0);};
int color[408][4];
ll has(int a[])
{
ll res=0;
for(int i=N-1;i>=0;i--) res=res*1000+a[i];
return res;
}
vector<ll> _rotate(int c[])
{
vector<ll> res;
// for(int i=0;i<N;i++) cout<<c[i]<... | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s308960611 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
long long n,a,b,x=1,y=1;
int main()
{
cin>>n;
while(n--)
{
cin>>a>>b;
int mid=max(x/a,y/b);
while(a*mid<x || b*mid<y) mid++;
x=a*sum,y=b*sum;
}
cout<<x+y;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:15: error: 'sum' was not declared in this scope
14 | x=a*sum,y=b*sum;
| ^~~
|
s694618803 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long n, smax = 1,
t, a;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> t >> a;
smax = max(smax, t + a);
}
long long tasum = t + a, tacount = 0;
while (tasum < smax)
{
... | a.cc: In function 'int main(int, const char**)':
a.cc:19:21: error: 'tacouunt' was not declared in this scope; did you mean 'tacount'?
19 | if (tasum * tacouunt > smax)
| ^~~~~~~~
| tacount
|
s678573827 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long n, smax = 1;
double t, a;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> t >> a;
smax = max(smax, t + a);
}
long long tasum = t + a, tacount = 0;
while (tasum < smax)
{
... | a.cc: In function 'int main(int, const char**)':
a.cc:12:19: error: no matching function for call to 'max(long long int&, double)'
12 | smax = max(smax, t + a);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/... |
s942070309 | p03966 | C++ | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
int int x, y;
size_t a, b;
cin >> a >> b;
for (int i = 1; i < N; ++i) {
cin >> x >> y;
size_t n = max(ceil(a * 1.0 / x), ceil(b * 1.0 / y));
... | a.cc: In function 'int main()':
a.cc:14:3: error: two or more data types in declaration of 'x'
14 | int int x, y;
| ^~~
a.cc:14:3: error: two or more data types in declaration of 'y'
a.cc:18:12: error: 'x' was not declared in this scope
18 | cin >> x >> y;
| ^
a.cc:18:17: error: 'y'... |
s999889322 | p03966 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n,i;
long long x=0,y=0;
cin >> n;
for(i=0;i<n;i++){
long long int p,q;
cin >> p >> q;
if(p>=x %% q>=y){
x=p; y=q;
}else if(p>q){
long long m=y/q;
if(y%q!=0)m++;
x=p*m; y=q*m;
}else if(p<q){... | a.cc: In function 'int main()':
a.cc:12:14: error: expected primary-expression before '%' token
12 | if(p>=x %% q>=y){
| ^
|
s169764003 | p03966 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
cin >> N;
unsigned long long t,a;
t = 1ll; a = 1ll;
unsigned long long A,T;
for(int i=0;i<N;i++){
cin >> T >> A;
long long i = (t+T-1)/T;
long long j = (a+A-1)/A;
long long k = max(i,j... | a.cc: In function 'int main()':
a.cc:14:19: error: redeclaration of 'long long int i'
14 | long long i = (t+T-1)/T;
| ^
a.cc:12:13: note: 'int i' previously declared here
12 | for(int i=0;i<N;i++){
| ^
|
s344289241 | p03966 | C | #define _CRT_SECURE_NO_WARNINGS
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int n;
int t[10000];
int a[10000];
int t1,a1;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &t[i], &a[i]);
}
int temp;
for (int i = 1; i < n; i++) {
temp = max((a[i - 1] + a[i] - 1) / a[i]... | main.c: In function 'main':
main.c:21:24: error: implicit declaration of function 'max'; did you mean 'fmax'? [-Wimplicit-function-declaration]
21 | temp = max((a[i - 1] + a[i] - 1) / a[i], (t[i - 1] + t[i] - 1)/ t[i]);
| ^~~
| fmax
|
s283274411 | p03966 | C | #define _CRT_SECURE_NO_WARNINGS
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int n;
int t[1000];
int a[1000];
int t1,a1;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &t[i], &a[i]);
}
int temp;
for (int i = 1; i < n; i++) {
temp = max((a[i - 1] + a[i] - 1) / a[i], ... | main.c: In function 'main':
main.c:21:24: error: implicit declaration of function 'max'; did you mean 'fmax'? [-Wimplicit-function-declaration]
21 | temp = max((a[i - 1] + a[i] - 1) / a[i], (t[i - 1] + t[i] - 1)/ t[i]);
| ^~~
| fmax
|
s152647448 | p03966 | C | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
/*
int n, k;
int a[15];
int main() {
scanf("%d %d", &n, &k);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int ans;
int color = 0;
for (int i = 1; i < n; i++) {
if (a[i - 1] < a[i]) {
color++;
}
}
while (color < k) {
color = 0;
for ... | main.c: In function 'main':
main.c:46:24: error: implicit declaration of function 'max'; did you mean 'fmax'? [-Wimplicit-function-declaration]
46 | temp = max((a[i - 1] + a[i] - 1) / a[i], (t[i - 1] + t[i] - 1)/ t[i]);
| ^~~
| fmax
|
s367633036 | p03966 | C++ | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
/*
int n, k;
int a[15];
int main() {
scanf("%d %d", &n, &k);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int ans;
int color = 0;
for (int i = 1; i < n; i++) {
if (a[i - 1] < a[i]) {
color++;
}
}
while (color < k) {
color = 0;
for ... | a.cc: In function 'int main()':
a.cc:46:24: error: 'max' was not declared in this scope; did you mean 'std::max'?
46 | temp = max((a[i - 1] + a[i] - 1) / a[i], (t[i - 1] + t[i] - 1)/ t[i]);
| ^~~
| std::max
In file included from /usr/include/c... |
s804535325 | p03966 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
int x;
long long int A=0;
long long int B=0;
for(int i=0;i<n;i++){
long long int t,a;
cin>>t>>a;
x=max(1,max(A/t,B/a));
while(A>t*x||B>a*x)x++;
A=x*t;
B=x*a;
}
cout<<A+B<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:22: error: no matching function for call to 'max(int, const long long int&)'
15 | x=max(1,max(A/t,B/a));
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c+... |
s149092539 | p03966 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
using namespace std;
#define ll long long
#define ld long d... | a.cc: In function 'int main()':
a.cc:40:13: error: no matching function for call to 'max(int, const long long int&)'
40 | ll i=max(1, max(x/t,y/a));
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s781486806 | p03966 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
using namespace std;
#define ll long long
#define ld long d... | a.cc: In function 'int main()':
a.cc:40:14: error: no matching function for call to 'max(int, const long long int&)'
40 | int i=max(1, max(x/t,y/a));
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s858691577 | p03966 | C++ | ##include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ll long long
#define int long long
using namespace std ;
const int MAXN = 101 * 1001 ;
int32_t main()
{
ios::sync_with_stdio(0) ;
cin.tie(0) ;
int n , a , b , x , y ;
cin >> n >> a >> b ;
for(int i = 1 ; i < ... | a.cc:1:1: error: stray '##' in program
1 | ##include<bits/stdc++.h>
| ^~
a.cc:1:3: error: 'include' does not name a type
1 | ##include<bits/stdc++.h>
| ^~~~~~~
a.cc:13:1: error: 'int32_t' does not name a type
13 | int32_t main()
| ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<c... |
s467397644 | p03966 | C++ | #include<iostream>
using namespace std;
int euclid(int a, int b){
int tmp;
if(a< b){
tmp= a;
a= b;
b= tmp;
}
if(a%b ==0) return b;
tmp= a% b;
a= b;
b= tmp;
return euclid(a,b);
}
int main(){
int n;
long long int *t, *a;
cin>> n;
t= new int[n];
a= new int[n];
for(int i=0; i<n; i++) cin>> t... | a.cc: In function 'int main()':
a.cc:26:12: error: cannot convert 'int*' to 'long long int*' in assignment
26 | t= new int[n];
| ^~~~~~~~~~
| |
| int*
a.cc:27:12: error: cannot convert 'int*' to 'long long int*' in assignment
27 | a= new int[n];
... |
s466345210 | p03966 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb... | a.cc: In function 'int main()':
a.cc:50:27: error: expected unqualified-id before '=' token
50 | ll=q=(a-1)/s+1;
| ^
a.cc:51:29: error: 'q' was not declared in this scope
51 | a=s*q;b=t*q;
| ^
|
s581379578 | p03966 | C++ | # include <stdio.h>
# include <string.h>
# define MAX(a,b) (a)>(b)?(a):(b)
typedef __int64 LL;
int main ()
{
int i, n, a, b;
LL x=1, y=1, d;
scanf("%d",&n);
for (i=1; i<=n; ++i) {
scanf("%d%d",&a,&b);
d=MAX((x+a-1)/a,(y+b-1)/b);
x=a*d; y=b*d;
}
printf("%I64d\n",x+y);
return 0;
} | a.cc:4:9: error: '__int64' does not name a type; did you mean '__int64_t'?
4 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
a.cc: In function 'int main()':
a.cc:9:9: error: 'LL' was not declared in this scope
9 | LL x=1, y=1, d;
| ^~
a.cc:13:17: error: 'd' was not ... |
s913010025 | p03966 | C++ | # include <stdio.h>
# include <string.h>
# define MAX(a,b) (a)>(b)?(a):(b)
typedef __int64 LL;
int main ()
{
int i, n, a, b;
LL x=1, y=1, d;
scanf("%d",&n);
for (i=1; i<=n; ++i) {
scanf("%d%d",&a,&b);
d=MAX((x+a-1)/a,(y+b-1)/b);
x=a*d; y=b*d;
}
printf("%I64d\n",x+y);
return 0;
} | a.cc:4:9: error: '__int64' does not name a type; did you mean '__int64_t'?
4 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
a.cc: In function 'int main()':
a.cc:9:9: error: 'LL' was not declared in this scope
9 | LL x=1, y=1, d;
| ^~
a.cc:13:17: error: 'd' was not ... |
s315134235 | p03966 | C++ | #include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<cmath>
using namespace std;
#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,... | a.cc: In function 'int main()':
a.cc:49:13: error: 'ct' was not declared in this scope; did you mean 't'?
49 | cout << ct + ca << endl;
| ^~
| t
a.cc:49:18: error: 'ca' was not declared in this scope; did you mean 'a'?
49 | cout << ct + ca << endl;
| ... |
s935142711 | p03966 | C++ | #include <iostream>
using namespace std;
int main(void){
// Here your code !
ilong long int n,a[2000],b[2000],da[2000],db[2000];
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%lld%lld",&a[i],&b[i]);
da[0]=a[0];
db[0]=b[0];
for(int i=1;i<n;i++){
while(da[i-1]>da[i]||db[i-1]>db[i]){da[i]+=a[i];db... | a.cc: In function 'int main()':
a.cc:5:5: error: 'ilong' was not declared in this scope; did you mean 'ulong'?
5 | ilong long int n,a[2000],b[2000],da[2000],db[2000];
| ^~~~~
| ulong
a.cc:6:17: error: 'n' was not declared in this scope
6 | scanf("%d",&n);
| ^
a.... |
s516249261 | p03966 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <cstdlib>
#include <Windows.h>
#define INT_MAX 2147483647
#d... | a.cc:16:10: fatal error: Windows.h: No such file or directory
16 | #include <Windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s113112542 | p03966 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef vector<int> V;
typedef unsigned long long ull;
typedef pair<ull, ull> P;
ull minMultipleAbove(int x, int a){
return a == 1 ? x : x + a - x % a;
}
double div(double x, double y){
return x / y;
}
P look(P votes, int t, int a){
double r1 = ... | a.cc: In function 'P look(P, int, int)':
a.cc:18:20: error: cannot convert 'div_t' to 'double' in initialization
18 | double r1 = div(t, a);
| ~~~^~~~~~
| |
| div_t
a.cc:19:20: error: call of overloaded 'div(long long unsigned int&, long lon... |
s726832603 | p03966 | C++ | //AtCoDeer and election_returns_prompt_report
#include <iostream>
#include <cmath>
int main(){
int n;
long long int t, a;
std::cin >> n;
long long int tt, aa;
std::cin >> tt >> aa;
for(int i=1;i<n;i++){
cin >> t >> a;
long long int n1, n2;
n1 = n2 = 0;
n1 = tt/t;
if(tt%t != 0){
n... | a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
13 | cin >> t >> a;
| ^~~
| std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< L... |
s890628373 | p03966 | C++ | //AtCoDeer and election_returns_prompt_report
#include <iostream>
#include <cmath>
int main(){
int n;
long long int t, a;
std::cin >> n;
long long int tt, aa;
std::cin >> tt >> aa;
for(int i=1;i<n;i++){
cin >> t >> a;
long long int n1, n2;
n1 = n2 = 0;
n1 = tt/t;
if(tt%t != 0){
n... | a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
13 | cin >> t >> a;
| ^~~
| std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< L... |
s201732326 | p03966 | C++ |
m = (s+e-1)/2;
if( (a[i]*m < a[i-1] or b[i]*m < b[i-1]) )
s = m+1;
else
e = m;
}
a[i] *= e, b[i] *= e;
}
if( n == 1 and a[0] + b[0] == 2 ) cout<<0<<endl;
else cout<<a[n-1]+b[n-1]<<endl;
return 0;
}
| a.cc:2:13: error: 'm' does not name a type
2 | m = (s+e-1)/2;
| ^
a.cc:3:13: error: expected unqualified-id before 'if'
3 | if( (a[i]*m < a[i-1] or b[i]*m < b[i-1]) )
| ^~
a.cc:5:13: error: expected unqualified-id before 'else'
5 | else... |
s966448509 | p03966 | Java | /* Filename: ARC062C.java
* Author: Mushiyo
*/
import java.util.Scanner;
public class ARC062C {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (input.hasNext()) {
int N = input.nextInt();
long T = input.nextLong(), A = input.nextLong();
for(int i = 2; i <=... | Main.java:7: error: class ARC062C is public, should be declared in a file named ARC062C.java
public class ARC062C {
^
1 error
|
s560657889 | p03966 | Java | N = int(input())
T,A = [0 for i in range(N)],[0 for i in range(N)]
for i in range(N):
T[i],A[i] = map(int,input().split())
a = 1
b = 1
for i in range(N):
low = 0
high = 10**18
while high - low > 1:
x = (high + low) // 2
if a <= T[i] * x and b <= A[i] * x:
high = x
els... | Main.java:1: error: class, interface, enum, or record expected
N = int(input())
^
1 error
|
s113166123 | p03966 | C++ | #include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{
int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,test1,test2;
cin>>num1;
for(int i=0;i<num1;i++){
cin>>test1>>test2;
if(i==0){
num2=test1;
num3=test2;
}
... | a.cc: In function 'int main()':
a.cc:21:39: error: invalid types 'int[int]' for array subscript
21 | if(num4>=test1[w]&&num5>=test2[w]){
| ^
a.cc:21:55: error: invalid types 'int[int]' for array subscript
21 | if(num4>=tes... |
s770118765 | p03966 | C++ | #include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{
int num1=0,num2=0,num3=0,num4=0,num5=0,test1=0,test2=0;
cin>>num1;
for(int i=0;i<num1;i++){
cin>>test1[i]>>test2[i];
}
num2=test1[0];
num3=test2[0];
if(w=0;w<... | a.cc: In function 'int main()':
a.cc:11:27: error: invalid types 'int[int]' for array subscript
11 | cin>>test1[i]>>test2[i];
| ^
a.cc:11:37: error: invalid types 'int[int]' for array subscript
11 | cin>>test1[i]>>test2[i];
| ... |
s448743527 | p03966 | C++ | #define REP(i,n) for (lli i=0;i<(n);i++)
#define rep(i,n) for (lli i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define PB push_back
#define pb push_back
#define all(a) (a).begin(),(a),end()
#define pll pair<lli,lli>
lli binary_search(lli a,lli b){
lli l=1,u=INF;
while(u-l>1){
lli mid =(l+u)/2;
if(mid*b>=a){
... | a.cc:10:1: error: 'lli' does not name a type
10 | lli binary_search(lli a,lli b){
| ^~~
a.cc: In function 'int main()':
a.cc:26:3: error: 'lli' was not declared in this scope
26 | lli N,t=1,a=1,d;
| ^~~
a.cc:27:6: error: expected ';' before 'T'
27 | lli T[1000],A[1000];
| ^~
... |
s996704658 | p03966 | C | #include<stdio.h>
int main() {
int N;
int T,A;
int i;
int k;
unsigned int realT = 1,realA = 1;
scanf("%d", &N);
for ( i = 0; i < N; i++ ) {
scanf("%d %d", &T, &A);
k = 1;
if ( T == A ) {
if ( realA < realT )
realA = realT;
else... | main.c:28:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
28 | p
| ^
|
s896145733 | p03966 | C++ | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <complex>
#include <ctime>
#include<cstdlib>
#define _USE_MATH_DEFINES
#include <math.h>
#include<c... | a.cc: In function 'int main()':
a.cc:126:19: error: 'FP_PE' was not declared in this scope; did you mean 'FP_ZERO'?
126 | fpsetprec(FP_PE);
| ^~~~~
| FP_ZERO
a.cc:126:9: error: 'fpsetprec' was not declared in this scope
126 | fpsetprec(FP_PE);
| ... |
s407607427 | p03966 | C++ | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <complex>
#include <ctime>
#include<cstdlib>
#define _USE_MATH_DEFINES
#include <math.h>
#include<c... | a.cc: In function 'int main()':
a.cc:131:28: error: call of overloaded 'ceil(const __float128&)' is ambiguous
131 | ll N = ceil(max(td, ad));
| ~~~~^~~~~~~~~~~~~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/b... |
s772606477 | p03966 | C++ | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <complex>
#include <ctime>
#include<cstdlib>
#define _USE_MATH_DEFINES
#include <math.h>
#include<c... | a.cc: In function 'int main()':
a.cc:131:28: error: call of overloaded 'ceil(const __float128&)' is ambiguous
131 | ll N = ceil(max(td, ad));
| ~~~~^~~~~~~~~~~~~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/b... |
s270059659 | p03966 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
using namespace std;
const int N = 100010;
char s[N];
int main() {
scanf("%s",s + 1); int n = strlen(s + 1), s0 = 0;
rep(i,1,n) if (s[i] == 'p') s0--;
cout <<s0 + n / 2<<endl;
} | a.cc: In function 'int main()':
a.cc:9:36: error: 'strlen' was not declared in this scope
9 | scanf("%s",s + 1); int n = strlen(s + 1), s0 = 0;
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'... |
s563674814 | p03966 | C++ | import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
public class Main {
private void solve(FastScanner sc) {
int n = sc.nextInt();
long tx = 1, ax = 1;
for (int i = 0; i < n; i++) {
int t = sc.nextInt();
int a = sc.nextIn... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.IOException;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.InputStream;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodu... |
s303400468 | p03966 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef unsigned int uint;
typedef long long int ll;
typedef unsigned long long int ull;
#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ... | a.cc: In function 'int main()':
a.cc:43:12: error: 'n' was not declared in this scope
43 | cin >> n;
| ^
|
s551746838 | p03966 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:24:20: error: 'L' was not declared in this scope
24 | if(L) L--, ret++;
| ^
|
s713707405 | p03966 | C++ | 5
3 10
48 17
31 199
231 23
3 2 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5
| ^
|
s914076187 | p03967 | C++ | ggppgggpggggppgggpgg#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istre... | a.cc:1:21: error: stray '#' in program
1 | ggppgggpggggppgggpgg#include <iostream>
| ^
a.cc:1:1: error: 'ggppgggpggggppgggpgg' does not name a type
1 | ggppgggpggggppgggpgg#include <iostream>
| ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
... |
s291736029 | p03967 | C++ | def main():
s = str(input())
num_g = 0
num_p = 0
ans = 0
for i in range(len(s)):
if s[i] == 'g':
num_g += 1
if s[i] == 'p':
if num_p < num_g:
num_p += 1
else:
ans -= 1
num_g += 1
s[i] = 'g'
for i in range(len(s)-1, -1, -1):
if s[i] == 'g':
... | a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s331282957 | p03967 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
ll i,G=0,P=0,ans;string S;cin>>S;
REP(i,S.size()){
if(S[i]=='p')P++;
... | a.cc: In function 'int main()':
a.cc:11:13: error: invalid declarator before '=' token
11 | ll i,G=0,P=0,ans;string S;cin>>S;
| ^
a.cc:13:19: error: expected unqualified-id before '++' token
13 | if(S[i]=='p')P++;
| ^~
a.cc:16:13: error: expected primary-expression ... |
s391978084 | p03967 | C++ | #include <bits/stdc++.h>
using namespace std;
//long long
using ll = long long;
// pair<int, int>
using PII = pair<int, int>;
//最大値、mod
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000001;
const long long LINF = 1e18;
... | a.cc: In function 'int main()':
a.cc:188:12: error: 's' was not declared in this scope
188 | cin >> s
| ^
a.cc:190:38: error: 'ans' was not declared in this scope; did you mean 'abs'?
190 | REP(i, s.size()) if(s[i] == 'p') ans--;
| ^~~
| ... |
s738213199 | p03967 | C++ | //INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a) (a).begin(),(a).end()
#define ALL(a,n) (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vect... | a.cc: In function 'int main()':
a.cc:31:15: error: expected initializer before '>>' token
31 | string cin>>s;
| ^~
a.cc:32:10: error: 's' was not declared in this scope
32 | ll N=s.size();
| ^
|
s156746730 | p03967 | C++ | //INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a) (a).begin(),(a).end()
#define ALL(a,n) (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vect... | a.cc: In function 'int main()':
a.cc:31:18: error: expected initializer before '>>' token
31 | string string>>s;
| ^~
a.cc:32:10: error: 's' was not declared in this scope
32 | ll N=s.size();
| ^
|
s056838507 | p03967 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
ll ans=s.size()/2;
for(int i=0;i<s.size();i++)if(s[i]=='p')ans--;
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
6 | ll ans=s.size()/2;
| ^~
a.cc:7:43: error: 'ans' was not declared in this scope; did you mean 'abs'?
7 | for(int i=0;i<s.size();i++)if(s[i]=='p')ans--;
| ^~~
... |
s893414346 | p03967 | C++ | #include<iostream>
using namespace std;
char s[100001] = { '\0' };
int main(void)
{
int sum = 0;
int sumg=0, sump=0;
cin >> s;
for (int i = 0; i <strlen(s); i++)
{
if (s[i] == 'g')
{
if (sump <sumg)
{
sump++;
sum++;
}
else if (sump >= sumg)
{
sumg++;
}
}
else if (s[i] == 'p')
... | a.cc: In function 'int main()':
a.cc:9:28: error: 'strlen' was not declared in this scope
9 | for (int i = 0; i <strlen(s); i++)
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostr... |
s534669119 | p03967 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;cin>>s;
int ans=0;
for(int i=0;i<s.size();i++){
if(i%2)if(s[i]=='g')k++;
else if(s[i]=='p')k--;
}
cout<<k<<endl;
} | a.cc: In function 'int main()':
a.cc:7:21: error: 'k' was not declared in this scope
7 | if(i%2)if(s[i]=='g')k++;
| ^
a.cc:8:23: error: 'k' was not declared in this scope
8 | else if(s[i]=='p')k--;
| ^
a.cc:10:9: error: 'k' was not declared in this scope... |
s133288819 | p03967 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define M... | a.cc: In function 'int main()':
a.cc:86:13: error: no matching function for call to 'max(ll&, int)'
86 | putout(max(ans,0));
| ~~~^~~~~~~
a.cc:26:25: note: in definition of macro 'putout'
26 | #define putout(x) cout<<x<<endl
| ^
In file included from /usr/include/c++... |
s459594613 | p03967 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define M... | a.cc: In function 'int main()':
a.cc:86:2: error: expected '}' at end of input
86 | }
| ^
a.cc:57:12: note: to match this '{'
57 | int main() {
| ^
|
s269566153 | p03967 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define M... | a.cc: In function 'int main()':
a.cc:65:15: error: 'pcount' was not declared in this scope; did you mean 'gcount'?
65 | if(s[i]=='g'&&pcount>0){
| ^~~~~~
| gcount
a.cc:70:1: error: 'pcount' was not declared in this scope; did you mean 'gcount'?
70 | pcount++;
| ^~~~~~... |
s105454842 | p03967 | C++ | s = input()
score = 0
g = 0
for i in s:
if g == 0:
g += 1
if i == "p":
score -= 1
elif g == 1:
g -= 1
if i == 'g':
score += 1
print(score) | a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s674142658 | p03967 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t... | a.cc:69:1: error: extended character is not valid in an identifier
69 | if(a[i]=="p")ans++
| ^
a.cc:69:1: error: extended character is not valid in an identifier
a.cc:13:12: error: 'uint8_t' does not name a type
13 | using u8 = uint8_t;
| ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined... |
s711518422 | p03967 | C++ | x#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<i... | a.cc:1:2: error: stray '#' in program
1 | x#include <iostream>
| ^
a.cc:1:1: error: 'x' does not name a type
1 | x#include <iostream>
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/... |
s060455872 | p03967 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int ans = n/2;
for (int i = 0; i < s.size(); i++){
if (s[i] == 'p') ans--;
}
printf("%d",ans);
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'n' was not declared in this scope
6 | int ans = n/2;
| ^
|
s625643978 | p03967 | Java | import java.util.Scanner;
import jdk.management.cmm.SystemResourcePressureMXBean;
public class Main {
public static void main(String[] args) {
Scanner input=new Scanner( System.in);
String string=input.next();
int len=string.length();
int ans=0;
for(int i=0;i<len;i+... | Main.java:3: error: package jdk.management.cmm does not exist
import jdk.management.cmm.SystemResourcePressureMXBean;
^
1 error
|
s623105061 | p03967 | C++ | s = gets.chomp.split('')
sum = 0
s.each_index do |i|
case s[i]
when 'g'
sum += i.even? ? 0 : 1
when 'p'
sum += i.even? ? (-1) : 0
end
end
puts sum
| a.cc:1:22: error: empty character constant
1 | s = gets.chomp.split('')
| ^~
a.cc:1:1: error: 's' does not name a type
1 | s = gets.chomp.split('')
| ^
|
s769105954 | p03967 | C++ | v | a.cc:1:1: error: 'v' does not name a type
1 | v
| ^
|
s489116203 | p03967 | C++ | #include <bits/stdc++.h>
#ifdef _WIN32
#include "debug.hpp"
#endif
using namespace std;
#define rep(i, N) for(int i = 0; i < (N); i++)
#define reps(i, N) for(int i = 1; i <= (N); i++)
#define repr(i, N) for(int i = (N) - 1; i >= 0; i--)
#define pub push_back
template<typename T>
void chmax(T &a, T b){ a = max(a, b)... | a.cc: In function 'void solve()':
a.cc:29:16: error: 'N' was not declared in this scope
29 | rep(i, N){
| ^
a.cc:7:40: note: in definition of macro 'rep'
7 | #define rep(i, N) for(int i = 0; i < (N); i++)
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.