criyle/codenet-compile-errors huggingface dataset:
Language: C++

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

int main(){
    int h1,m1,h2,m2,k
    cin >> h1 >> m1;
    cin >> h2 >> m2 >> k;
    cout << max(h2*60+m2-h1*60-m1-k,0) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
    6 |     cin >> h1 >> m1;
      |     ^~~
a.cc:7:24: error: 'k' was not declared in this scope
    7 |     cin >> h2 >> m2 >> k;
      |                        ^
Language: C++

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

int main(){
  int h1,m2,h2,m2,k;
    cin >> h1 >> m1;
    cin >> h2 >> m2 >>k ;
    cout << max(h2*60+m2-h1*60-m1-k,0) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: redeclaration of 'int m2'
    5 |   int h1,m2,h2,m2,k;
      |                ^~
a.cc:5:10: note: 'int m2' previously declared here
    5 |   int h1,m2,h2,m2,k;
      |          ^~
a.cc:6:18: error: 'm1' was not declared in this scope; did you mean 'm2'?
    6 |     cin >> h1 >> m1;
      |                  ^~
      |                  m2
Language: C

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  int h1, h2, m1, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int h = h2 - h1, m = m2 - m1;
  int all = h * 60 + m;
  cout << all-k << endl;
  return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>
#include<stack>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;

ll INF = 9*1e18;

int main() {
	int n;
	cin >> n;
	vector<ll> outt(n + 1);
	rep(i, n + 1) cin >> outt[i];
    if(n==0&&out[0]==1){
      cout<<1<<endl;
      return 0;
    }
    if(outt[0]!=0){
      cout<<-1<<endl;
      return 0;
    }
	vector<ll> ok(n + 1);
	ok[0] = (ll)1;
	vector<ll> maxx(n + 1, INF), minn(n + 1,(ll)0);
	maxx[n] = 0;
	for (int i = n - 1; i >= 0; i--) {
		minn[i] = (minn[i + 1] + outt[i + 1] + 1) / 2;
		if (maxx[i + 1] != INF) {
			ll cnt;
			cnt = maxx[i + 1] + outt[i + 1];
			if (cnt < INF) maxx[i] = cnt;
		}
	}

	rep(i, n) {
		ll cnt = 2 * ok[i] - outt[i + 1];
		cnt = min(cnt, maxx[i + 1]);
		if (cnt < minn[i + 1]) {
			cout << -1 << endl;
			return 0;
		}
		ok[i + 1] = cnt;
	}
	ll ans = 0;
	rep(i, n + 1) ans += ok[i] + outt[i];
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'out' was not declared in this scope; did you mean 'outt'?
   24 |     if(n==0&&out[0]==1){
      |              ^~~
      |              outt
Language: C++

#include<iostream>
 
using namespace std;
 
int main(void){
  int h1,m1,h2,m2,k;
  cin>>h1>>m1>>h2>>m2>>k;
  int result =(h2*60+m2-(60*h1+m1+1))/k * k
  if(result < 0)cout<<"0";
  else cout<<result<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'if'
    9 |   if(result < 0)cout<<"0";
      |   ^~
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else cout<<result<<endl;
      |   ^~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        
        int tmpb = c * 60 + d;
        int tmpa = a * 60 + b;
        
        int tmpc = tmpb - tmpa;
        int tmpd = tmpc / e;
        int tmpx = tmpc - e;
        System.out.println(tmpx);
    }
}
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        
        int tmpb = c * 60 + d;
        int tmpa = a * 60 + b;
        
        int tmpc = tmpb - tmpa;
        int tmpd = tmpc / e;
        int tmpx = tmpc - e;
        System.out.println(tmpx);
    }
}


Compiler output:
Main.java:22: error: class, interface, enum, or record expected
import java.util.*;
^
1 error
Language: C++

 #include <bits/stdc++.h>
using namespace std;
int main(){

    string input;

    cin >> input;

    string pd = input;
    string capital,preCapital;

    for(int i = 0; i < (int)pd.size(); ++i){

        if(pd[i] == "?"){
          capital = 'D';
        }else{
          capital = pd[i];
        }

        ans = ans + capital;
    }
    
    printf("%s\n",ans.c_str());


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         if(pd[i] == "?"){
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |         ans = ans + capital;
      |         ^~~
      |         abs
a.cc:23:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     printf("%s\n",ans.c_str());
      |                   ^~~
      |                   abs
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class AA {
    static Scanner sc = new Scanner(System.in);
    static ArrayList<Integer> IntList = new ArrayList<Integer>();
    static ArrayList<String> StrList = new ArrayList<String>();
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ



    	int ans1 = sc.nextInt();
    	int ans2 = sc.nextInt();
    	int ans3 = sc.nextInt();
    	int ans4 = sc.nextInt();
    	int ans5 = sc.nextInt();

    	int cont = 0;

    	int a = ans3 - ans1;

    	int ans = a * 60;

    	int sum = ans - ans2 - ans4 - ans5;

    	System.out.println(sum);



    }
}

Compiler output:
Main.java:4: error: class AA is public, should be declared in a file named AA.java
public class AA {
       ^
1 error
Language: C

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

int main() {
  int H1,M1,H2,M2,K;
  cin>>H1>>M1>>H2>>M2>>K;
  cout<<H2*60+M2-(H1*60+M1)-K<<endl;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main()
{
int h1,m1,h2,m2,k;
cin>>h1>>m1>>h2>>m2>>k;
cout<<(60-m1)+(((h2-h1)-1)*60)-k+m2<<endl;
}


Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++


int main()
{
    ll H1, M1, H2, M2, K;

    cin >> H1 >> M1 >> H2 >> M2 >> K;

   int h = H2 - H1;
   int m = 0;

   if(M1<M2) {
       m = M2 - M1;
   } else {
       m = M1 = M2;
   }

   cout << ( h*60 + m ) - K << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll H1, M1, H2, M2, K;
      |     ^~
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> H1 >> M1 >> H2 >> M2 >> K;
      |     ^~~
a.cc:6:12: error: 'H1' was not declared in this scope
    6 |     cin >> H1 >> M1 >> H2 >> M2 >> K;
      |            ^~
a.cc:6:18: error: 'M1' was not declared in this scope
    6 |     cin >> H1 >> M1 >> H2 >> M2 >> K;
      |                  ^~
a.cc:6:24: error: 'H2' was not declared in this scope
    6 |     cin >> H1 >> M1 >> H2 >> M2 >> K;
      |                        ^~
a.cc:6:30: error: 'M2' was not declared in this scope
    6 |     cin >> H1 >> M1 >> H2 >> M2 >> K;
      |                              ^~
a.cc:6:36: error: 'K' was not declared in this scope
    6 |     cin >> H1 >> M1 >> H2 >> M2 >> K;
      |                                    ^
a.cc:17:4: error: 'cout' was not declared in this scope
   17 |    cout << ( h*60 + m ) - K << endl;
      |    ^~~~
a.cc:17:32: error: 'endl' was not declared in this scope
   17 |    cout << ( h*60 + m ) - K << endl;
      |                                ^~~~
Language: Java

import java.util.Scanner;

public class Acc2005301{
	public static void main(String[] args){
		int s[]=new int[5];
		int h,h1,h2,okirum,m,m1,m2,k,ans;
		Scanner sc = new Scanner(System.in);
			h1= sc.nextInt();
			m1= sc.nextInt();
			h2= sc.nextInt();
			m2= sc.nextInt();
			k= sc.nextInt();
			h=h2-h1;
			m=m2-m1;
			okirum=m+60*h;
			if(okirum<=k){
				System.out.printf("0");
			}
			else{
				ans=okirum-k;
				System.out.printf("%d",ans);
			}

	}
}


Compiler output:
Main.java:3: error: class Acc2005301 is public, should be declared in a file named Acc2005301.java
public class Acc2005301{
       ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int h1,h2,m1,m2,k;
  int minutes,hours;
  cin>>h1>>h2>>m1>>m2>>k;
  if(m2>m1)
    
        --m1;
        m1+= 60;
    
    minutes = m1-m2;
    hours = t1-t2;
  long long m=(hours*60)+minutes-k;
  cout<<m;
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 't1' was not declared in this scope; did you mean 'm1'?
   14 |     hours = t1-t2;
      |             ^~
      |             m1
a.cc:14:16: error: 't2' was not declared in this scope; did you mean 'm2'?
   14 |     hours = t1-t2;
      |                ^~
      |                m2
Language: C++

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

int main(){
  int H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;
  int s, t ;
  t  =( H2 * 60 + M2 ) -  (H1 * 60 + M1);
  s = t - K;
  cout << s << endl;
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspace'
    2 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> H1 >> M1 >> H2 >> M2 >> K;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout << s << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   cout << s << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
    int H_1, M_1, H_2, M_2, K;
    cin >> H_1 >> M_1 >> H_2 >> M_2 >> K;

    int kakusei_time;
    int ans;
    kakusei_time = (M_2 + H_2 * 60) - (M_1 + H_1 * 60);
    ans = kakusei_time / K;
    ans--;
    ans = ans * K 
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: expected ';' before 'cout'
   13 |     ans = ans * K
      |                  ^
      |                  ;
   14 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main() {
    int H_1, M_1, H_2, M_2, K;
    cin >> H_1 >> M_1 >> H_2 >> M_2 >> K;

    int kakusei_time;
    int ans
    kakusei_time = (M_2 + H_2 * 60) - (M_1 + H_1 * 60);
    ans = kakusei_time / K;
    ans--;
    ans = ans * K 
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected initializer before 'kakusei_time'
   10 |     kakusei_time = (M_2 + H_2 * 60) - (M_1 + H_1 * 60);
      |     ^~~~~~~~~~~~
a.cc:11:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     ans = kakusei_time / K;
      |     ^~~
      |     abs
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int h1,h2,m1,m2,k;
  cin>>h1>>h2>>m1>>m2>>k;
  if(m2>m1)
    
        --m1;
        m1+= 60;
    }
    int minutes = m1-m2;
    int hours = h1-h2;
  long long m=(hours*60)+minutes-k;
  cout<<m;
  return 0;
  
}

Compiler output:
a.cc:12:19: error: 'm1' was not declared in this scope
   12 |     int minutes = m1-m2;
      |                   ^~
a.cc:12:22: error: 'm2' was not declared in this scope
   12 |     int minutes = m1-m2;
      |                      ^~
a.cc:13:17: error: 'h1' was not declared in this scope
   13 |     int hours = h1-h2;
      |                 ^~
a.cc:13:20: error: 'h2' was not declared in this scope
   13 |     int hours = h1-h2;
      |                    ^~
a.cc:14:34: error: 'k' was not declared in this scope
   14 |   long long m=(hours*60)+minutes-k;
      |                                  ^
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout<<m;
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int h1,h2,m1,m2,k;
  cin>>h1>>h2>>m1>>m2>>k;
  if(m2>m1)
  {
        --m1;
        m1+= 60;
    }
    int minutes = m1-m2;
    int hours = h1-t2;
  long long m=(hours*60)+minutes-k;
  cout<<m;
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 't2' was not declared in this scope; did you mean 'm2'?
   13 |     int hours = h1-t2;
      |                    ^~
      |                    m2
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int h1,h2,m1,m2,k;
  cin>>h1>>h2>>m1>>m2>>k;
  if(m2>m1)
    
        --m1;
        m1+= 60;
    }
    int minutes = m1-m2;
    int hours = h1-t2;
  long long m=(hours*60)+minutes-k;
  cout<<m;
  return 0;
  
}

Compiler output:
a.cc:12:19: error: 'm1' was not declared in this scope
   12 |     int minutes = m1-m2;
      |                   ^~
a.cc:12:22: error: 'm2' was not declared in this scope
   12 |     int minutes = m1-m2;
      |                      ^~
a.cc:13:17: error: 'h1' was not declared in this scope
   13 |     int hours = h1-t2;
      |                 ^~
a.cc:13:20: error: 't2' was not declared in this scope; did you mean 'tm'?
   13 |     int hours = h1-t2;
      |                    ^~
      |                    tm
a.cc:14:34: error: 'k' was not declared in this scope
   14 |   long long m=(hours*60)+minutes-k;
      |                                  ^
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout<<m;
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C

#include<stdio.h>
main()
{
  int H1,M1,H2,M2,K,;
  scanf("%d%d%d%d%d",&H1,&M1,&H2,&M2,&K);
 
  printf("%d",(H2-H1)*60+(M2-M1)-K);
}


Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:4:21: error: expected identifier or '(' before ';' token
    4 |   int H1,M1,H2,M2,K,;
      |                     ^
Language: C++

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

int main() {
  int H[1],M[1],H[2],M[2],K;
  cin >>H[1]>>M[1]>>H[2]>>M[2]>>K;
  
  cout<< 60*H[2]+M[2] - 60*H[1]+M[1] -K << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: conflicting declaration 'int H [2]'
    5 |   int H[1],M[1],H[2],M[2],K;
      |                 ^
a.cc:5:7: note: previous declaration as 'int H [1]'
    5 |   int H[1],M[1],H[2],M[2],K;
      |       ^
a.cc:5:22: error: conflicting declaration 'int M [2]'
    5 |   int H[1],M[1],H[2],M[2],K;
      |                      ^
a.cc:5:12: note: previous declaration as 'int M [1]'
    5 |   int H[1],M[1],H[2],M[2],K;
      |            ^
Language: C

#include<stdio.h>
main()
{
  int H1,M1,H2,M2,K,s;
  scanf("%d%d%d%d%d",H1,M1,H2,M2,K);
  s=(H2-H1)*60+(M2-M1)-K
  printf("s");

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:6:25: error: expected ';' before 'printf'
    6 |   s=(H2-H1)*60+(M2-M1)-K
      |                         ^
      |                         ;
    7 |   printf("s");
      |   ~~~~~~                 
main.c:7:3: error: expected declaration or statement at end of input
    7 |   printf("s");
      |   ^~~~~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int H1,H2,M1,M2,K;

    cin >> H1 >> M1 >> H2 >> M2 >> K;

    int time1,time2,time3;
    time1 = abs(H2 - H1)*60;
    time2 = abs(M2 - M1);


    time3 = time1+time2;

    if(K >= time3)
    {
        cout << 0 << endl;
    }
    else if(K < time3)
    {
        cout << time3 - K << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:6: error: expected '}' at end of input
   23 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main() {
  int length;
  
  string str;
  cin >> str;

  length = str.size();
  
  for(int i=0;i<length;i++) {
    if(str[i] == '?') {
      if(i == 0 && str[i+1] == 'D') {
        str.replace(i, 1, "P");
      }else if(i == 0 && str[i+1] == 'P') {
        str.replace(i, 1, "D");
      }else if(str[i-1] == 'P' || i = length) {
        str.replace(i, 1, "D");
      } else if(str[i+1] == 'D') {
        str.replace(i, 1, "P");
      } else {
        str.replace(i, 1, "D");
      }
    }
  }
  cout << str << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: lvalue required as left operand of assignment
   20 |       }else if(str[i-1] == 'P' || i = length) {
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int h,m,h1,m1,k,o;
    cin>>h>>m>>h1>>m1>>k;
    if(h<=h1&&m==m1)cout<<((h1+(m1/12))-(h+(m/12)))*60+(m-m1)-k<<endl;
    else if(h<=h1&&m<m1)cout<<((h1+(m1/12))-(h+(m/12)))*60+(m1-m)-k<<endl;
    else if(h<=h1&&m>m1)cout<<((h1+(m1/12))-(h+(m/12))-1)*60+(60-m)+m1-k<<endl;
    else if(h>=h1&&m<m1)cout<<(24-((h+(m/12))-(h1+(m1/12)))*60+(m1-m)-k<<endl;
    else if(h>=h1&&m>m1)cout<<(23-((h+(m/12))-(h1+(m1/12)))*60+(60-m)+m1-k<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:72: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |     else if(h>=h1&&m<m1)cout<<(24-((h+(m/12))-(h1+(m1/12)))*60+(m1-m)-k<<endl;
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:10:78: error: expected ')' before ';' token
   10 |     else if(h>=h1&&m<m1)cout<<(24-((h+(m/12))-(h1+(m1/12)))*60+(m1-m)-k<<endl;
      |                               ~                                              ^
      |                                                                              )
a.cc:11:75: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   11 |     else if(h>=h1&&m>m1)cout<<(23-((h+(m/12))-(h1+(m1/12)))*60+(60-m)+m1-k<<endl;
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:11:81: error: expected ')' before ';' token
   11 |     else if(h>=h1&&m>m1)cout<<(23-((h+(m/12))-(h1+(m1/12)))*60+(60-m)+m1-k<<endl;
      |                               ~                                                 ^
      |                                                                                 )
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main() {
  int length;
  
  string str;
  cin >> str;

  length = str.size();
  
  for(int i=0;i<length;i++) {
    if(str[i] == '?') {
      if(i == 0 && str[i+1] == 'D') {
        str.replace(i, 1, "P");
      }else if(i == 0 && str[i+1] == 'P') {
        str.replace(i, 1, "D");
      }else if(str[i-1] == 'P' || i = length-1) {
        str.replace(i, 1, "D");
      } else if(str[i+1] == 'D') {
        str.replace(i, 1, "P");
      } else {
        str.replace(i, 1, "D");
      }
    }
  }
  cout << str << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: lvalue required as left operand of assignment
   20 |       }else if(str[i-1] == 'P' || i = length-1) {
Language: C

#include <stdio.h>

void time(int *H1, int *M1, int *K) {
    int a;
    a = *K/60;
    for(int i = 1; i <= a; i++) {
        *H1 = *H1 + 1;
        *M1 = *M1 - 60;
    }
}

int main(void) {
    int H1, H2, M1, M2, K;
    int a, sum = 0;
    scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
    while(1) {
        M1 = M1 + K;
        if(M1 >= 60 && K >= 60) {
            time(&H1, &M1, &K);

            if(H1 >= H2 && M1 >= M2) {
                break;
            }
        }
        else if(M1 >= 60 && K < 60) {
            M1 = M1 - 60;
            H1 = H1 + 1;
            if(H1 >= H2 && M1 >= M2) {
                break;
            }
        }
        sum=sum + K;
    }
    printf("%d\n", sum);
    return 0;

Compiler output:
main.c: In function 'main':
main.c:35:5: error: expected declaration or statement at end of input
   35 |     return 0;
      |     ^~~~~~
Language: C++

#include<iostream>
using namespave std;
int main(){
 int a,b;
  cin>>a>>b;
  int c,d;
  cin>>c>>d;
  int k;
  cin>>k;
  int min=0;
  min=60-b;
  min+=d;
  min=min+(a-c-1);
  cout<<min-k<<endl;
  
  
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespave'
    2 | using namespave std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>a>>b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout<<min-k<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout<<min-k<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  
  int H,M,X,Y,K;
  cin >> H >> M >> X >> Y >> K;
  
  cout << ( (X-H)*60 - (M-Y)) - K << endl; 


Compiler output:
a.cc: In function 'int main()':
a.cc:9:43: error: expected '}' at end of input
    9 |   cout << ( (X-H)*60 - (M-Y)) - K << endl;
      |                                           ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C


#include <stdio.h>
#include <stdlib.h>
#include <iostream>

int main(){
    int H1;
    int M1;
    int H2;
    int M2;
    int K;

    cin >> H1 >> M1 >> H2 >> M2 >> K;


    int wakeUpTime = H1 * 60 + M1;
    int sleepTime = H2 * 60 + M2;;

    int studyTime = sleepTime - wakeUpTime - K;

    printf("%d\n",studyTime);

	return 0;
}

Compiler output:
main.c:4:10: fatal error: iostream: No such file or directory
    4 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

int main() {
	int h, m, h2, m2, k, calcH, ans;
	cin >> h >> m >> h2 >> m2 >> k;
	calcH = h2 - h;
	if (calcH < 1) {
		cout << m2 - m << endl;
	}
	else {
		ans = calcH * 60;
		if (m2 - m > -1) {
			ans += m2 - m;
		}
		else {
			ans -= sqrt((m2 - m) * (m2 - m));
		}
		cout << ans - k << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: 'sqrt' was not declared in this scope
   17 |                         ans -= sqrt((m2 - m) * (m2 - m));
      |                                ^~~~
Language: C

#include<stdio.h>

int main(){
    int H1, H2, M1, M2, K;

    scanf_s("%d", &H1);
    scanf_s("%d", &M1);
    scanf_s("%d", &H2);
    scanf_s("%d", &M2);
    scanf_s("%d", &K);

    printf("%d", (H2 - H1) * 60 + (M2 - M1) - K);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |     scanf_s("%d", &H1);
      |     ^~~~~~~
      |     scanf
Language: C

//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define F first
#define S second
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;
ll vis[N],res[N];

int solve() 
{
	//happy coding

	int h1,m1,h2,m2,n;
	cin>>h1>>m1>>h2>>m2>>n;
	
	int h = abs(h2 - h1)-1;
	int m = 0;
	if(m1<=m2){
		h++;
		m = abs(m2-m1);
	}else{
		m = (m1+m2);
	}

	int x = h*60+m;

	int ans = ceil(x/n)-1;
	cout<<ans*n<<endl;

	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}

Compiler output:
main.c:3:9: fatal error: bits/stdc++.h: No such file or directory
    3 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std ;


int main()
{
	int H1, M1, H2, M2, K,tmp,tmp2,tmp3;
	cin >> H1 >> M1 >> H2 >> M2 >> K;
  if(M2>=M1){
    tmp = H2-H1;
    tmp2=M2-M1;
  }else{
    tmp = H2-H1-1;
    tmp2=M2-M1+1;
  }
	tmp3=tmp*60+tmp2;
  if(tmp3>=K){
  	cout << tmp3-K << "\n";
  }else{
    cout << 0 << "\n";
  }
  return 0;
}
}

Compiler output:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    string T;

    cin >> T;

    for(int i = 0; i<T.length(); i++){
        if(i==0&&T[i]=='?'){
            T[i] = 'D';
        }
        if(i==T.length&&T[i]=='?'){
            T[i] = 'D';
        }
        if(T[i] == '?'){
            if(T[i-1] == 'D' && T[i+1] == 'D'){
                T[i] = 'P';
            }else{
                T[i] = 'D';
            }
        }
    }

    cout << T << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   14 |         if(i==T.length&&T[i]=='?'){
      |               ~~^~~~~~
      |                       ()
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;

class AStudyScheduling {
public:
	void solve(std::istream& cin, std::ostream& cout) {
	    int h1,m1,h2,m2,k;
	    cin>>h1>>m1>>h2>>m2>>k;

	    int time = (h2-h1)*60;
	    if((m2-m1)<0) time += 60-abs(m2-m1);
	    else time += m2-m1;
	    time -= k;
        cout<<time<<endl;




	}
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

// atcoder.cpp.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include<stdio.h>
#include<string.h>
#include <math.h>
#include<stdlib.h>
#include<time.h>
#include<random>

using namespace std;
//std::random_device rnd;

int onlynumber(int s, int e);

//グロ変

int main()
{
    
    int h1, m1, h2, m2, k;
    int ans = 0;
    char enter[100];
    char* enpo;

/*    cin >> enter;
         h1= strtol(enter, &enpo, 10);
         m1= strtol(enpo, &enpo, 10);
         h2= strtol(enpo, &enpo, 10);
         m2= strtol(enpo, &enpo, 10);
         k= strtol(enpo, &enpo, 10);*/
    cin >> h1;
    cin >> m1;
    cin >> h2;
    cin >> m2;
    cin >> k;


         //cout << h1 << m1 << h2 << m2 << k;
    ans = (h2 * 60 + m2) - (h1 * 60 + m1) - k;
    cout << ans;


   
}


/*if (15 * A[t] >= 10 * B[t] >= 6 * C[t]) {

            }

            if (15 * A[t] >= 10 * C[t] >= 6 * B[t]) {

            }
            if (15 * B[t] >= 10 * A[t] >= 6 * C[t]) {

            }
            if (15 * B[t] >= 10 * C[t] >= 6 * A[t]) {

            }
            if (15 * C[t] >= 10 * B[t] >= 6 * A[t]) {

            }
            if (15 * C[t] >= 10 * A[t] >= 6 * B[t]) {

            }*/

int  onlynumber(int s, int e) {
    int d;
    char* enpo;
    char str[100];
    do {
        scanf_s("%s", &str,5);
        d = strtol(str, &enpo, 10);
        if (*enpo == '\0' && d >= s && d <= e) {
            break;
        }
    } while ((*enpo != '\0') || (d < s || d > e));
    return d;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Compiler output:
a.cc: In function 'int onlynumber(int, int)':
a.cc:74:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   74 |         scanf_s("%s", &str,5);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())で降順に、*max_element(all(変数))で最大値を獲得
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric>
// xとyのgcdは__gcd(x,y),xとyのlcmは(x*y)/__gcd、accumulate(all(変数),0)で要素の全加算
#include<queue>//priority_queue<型名> 変数
#include<set>
#include<stack>
#include<string>//変数.substr(どこから,いくつ)
#include<vector>
#define rep(i,n)  for(ll i=0; i<n; i++)
#define rrep(i,n) for(ll i=n-1; 0<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e9
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
  int h1,m1,h2,m2,k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int time;
  if(m1 <= m2) time = (h2-h1)*60 + (m2-m1-1);
  else time = (h2-1-h1)*60 + (60+m2-m1-1);
  int ans = 0;
  rep(i,time) if(i%k==0 ans i!=0) ans += k;
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: expected ')' before 'ans'
   34 |   rep(i,time) if(i%k==0 ans i!=0) ans += k;
      |                 ~      ^~~~
      |                        )
Language: C++

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

int main() {
  int t[4];
  for (int i = 0; i < 4; i++) cin >> t[x];
  int k;
  cin >> k;
  
  cout << t[1] * 60 + t[2] - t[0] * 60 - t[1] - k << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: 'x' was not declared in this scope
    6 |   for (int i = 0; i < 4; i++) cin >> t[x];
      |                                        ^
Language: C

#include<stdio.h>
 
int main(){
  
  int H1,M1,H2,M2,K;
    int h=H2-H1;
  int m=M2-M1;
  int T=h*60+m-K;
  
  while((H1>23)||(H2>23)||(M1>59)||(M2>59)||(H1>H2)||(M1>M2)||(h==m==0)||){
  while(scanf("%d %d %d %d %d",&H1,&M1,&H2,&M2,&K)==0);
    if(T<1)
      continue;
    
  }
  
        
        printf("%d",T);
        
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:74: error: expected expression before ')' token
   10 |   while((H1>23)||(H2>23)||(M1>59)||(M2>59)||(H1>H2)||(M1>M2)||(h==m==0)||){
      |                                                                          ^
Language: C++

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

int main() {
  int[] t = new int[4];
  for (int x : t) cin >> t[x];
  int k;
  cin >> k;
  
  cout << t[0] * 60 + t[1] - t[2] * 60 - t[3] - k << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: structured binding declaration cannot have type 'int'
    5 |   int[] t = new int[4];
      |      ^~
a.cc:5:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:6: error: empty structured binding declaration
a.cc:5:9: error: expected initializer before 't'
    5 |   int[] t = new int[4];
      |         ^
a.cc:6:16: error: 't' was not declared in this scope
    6 |   for (int x : t) cin >> t[x];
      |                ^
a.cc:10:11: error: 't' was not declared in this scope
   10 |   cout << t[0] * 60 + t[1] - t[2] * 60 - t[3] - k << endl;
      |           ^
Language: C++

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

int main() {
  int[] t = new int[4];
  for (int x : t) cin >> t[x];
  int k;
  cin >> k;
  
  cout << t[0] * 60 + t[1] - t[2] * 60 - t[3] - k << endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspace'
    2 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:6: error: structured binding declaration cannot have type 'int'
    5 |   int[] t = new int[4];
      |      ^~
a.cc:5:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:6: error: empty structured binding declaration
a.cc:5:9: error: expected initializer before 't'
    5 |   int[] t = new int[4];
      |         ^
a.cc:6:16: error: 't' was not declared in this scope
    6 |   for (int x : t) cin >> t[x];
      |                ^
a.cc:6:19: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   for (int x : t) cin >> t[x];
      |                   ^~~
      |                   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> k;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout << t[0] * 60 + t[1] - t[2] * 60 - t[3] - k << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:11: error: 't' was not declared in this scope
   10 |   cout << t[0] * 60 + t[1] - t[2] * 60 - t[3] - k << endl;
      |           ^
a.cc:10:54: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   cout << t[0] * 60 + t[1] - t[2] * 60 - t[3] - k << endl;
      |                                                      ^~~~
      |                                                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.*;

public class main {
	public static void main(String[] args) throws Exception {
		Scanner scn = new Scanner(System.in);
		int h1 = scn.nextInt();
		int m1 = scn.nextInt();
		int h2 = scn.nextInt();
		int m2 = scn.nextInt();
		int k = scn.nextInt();
		int tt = (h2 * 60 + m2) - (h1 * 60 + m1);
		System.out.println(tt - k);
		return;
	}

}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int h1,m1,h2,m2,k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int a = h2 - h1;
  int b = m2 - m1;
  cout<<(a - b) * 60 - k<<endl;
  return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java


import java.util.*;
import java.io.*;

public class main {
	public static void main(String[] args) throws Exception {
		new main().print();
		return;
	}

	void print() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] str = (br.readLine()).trim().split(" ");
		int h1 = Integer.parseInt(str[0]);
		int m1 = Integer.parseInt(str[1]);
		int h2 = Integer.parseInt(str[2]);
		int m2 = Integer.parseInt(str[3]);
		int k = Integer.parseInt(str[4]);

		int tt = (h2 * 60 + m2) - (h1 * 60 + m1);
		System.out.println(tt - k);
	}
}


Compiler output:
Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C

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

int main() {
  int H1,M1,H2,M2,K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;
  cout << H2 * 60 + M2 - H1 * 60 + M1 - K<< endl;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int  h1,h2,m1,m2;
    int k;
    cin>>h1>>m1>>h2>>m2>>k;
    h1 = h1*60+m1;
    h2 = h2*60+m2;
   int temp = h2-h1;
   int flag = (h2-h1)%k;
   if(h2-h1<= k)
   {
       print("0");
   }
   else if(flag == 0)
   {
       printf("%d",temp-k);
   }
   else
   {
       printf("%d",temp-flag);
   }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'print' was not declared in this scope; did you mean 'rint'?
   18 |        print("0");
      |        ^~~~~
      |        rint
Language: C

#include<iostream>
using namespace std;
int main()
{
  int h1,m1,h2,m2,k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int a = h2 - h1;
  int b = m2 - m1;
  cout<<(a - b) * 60 + k<<endl;
  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int ha,ma,h,m,k,i,ans;
    cin>>ha>>ma>>h>>m>>k;
  ans=60-ma+m;
  i=h-ha-1;
  i=i*60;
  ans=ans+i;
  ans=ans-k;
  cout<<ans<<endl;
  return o;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'o' was not declared in this scope
   13 |   return o;
      |          ^
Language: C++

#include<iostream>
using namespace std;
int main{
 int h1,m1,h2,m2,k,x,y,z
  cin>>h1>>m1>>h2>>m2>>k;
  h1=h1*60;
  h2=h2*60;
  x=h1+m1;
  y=h2+m2;
  z=y-x-k;
  if(y-x<=k)
    cout<<"0";
  else
    cout<<z;
  return 0;
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:2: error: expected primary-expression before 'int'
    4 |  int h1,m1,h2,m2,k,x,y,z
      |  ^~~
a.cc:4:2: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:3: error: 'h1' does not name a type
    6 |   h1=h1*60;
      |   ^~
a.cc:7:3: error: 'h2' does not name a type
    7 |   h2=h2*60;
      |   ^~
a.cc:8:3: error: 'x' does not name a type
    8 |   x=h1+m1;
      |   ^
a.cc:9:3: error: 'y' does not name a type
    9 |   y=h2+m2;
      |   ^
a.cc:10:3: error: 'z' does not name a type
   10 |   z=y-x-k;
      |   ^
a.cc:11:3: error: expected unqualified-id before 'if'
   11 |   if(y-x<=k)
      |   ^~
a.cc:13:3: error: expected unqualified-id before 'else'
   13 |   else
      |   ^~~~
a.cc:15:3: error: expected unqualified-id before 'return'
   15 |   return 0;
      |   ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main () {
  int h, m, h_, w_, K;
  cin >> h >> m >> h_ >> w_ >> K;
  cout << (h_ - h) * 60 + m_ - m - K << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: 'm_' was not declared in this scope; did you mean 'w_'?
    6 |   cout << (h_ - h) * 60 + m_ - m - K << endl;
      |                           ^~
      |                           w_
Language: C++

#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define str string
#define vec vector
#define ff first
#define ss second
#define ins insert
#define ps push_back
#define pp pop_back
#define sz size()
#define len length()
#define umap unordered_map
#define uset unordered_set
#define all(cont) begin(cont), end(cont)
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int k;
    int h = 0, m = 0;
    pair<int, int> s, e;
    cin >> s.ff >> s.ss >> e.ff >> e.ss >> k;
    for (int i = s.ff, j = s.ss;;) {
        if (i != e.ff) {
            i = (i + 1) % 24;
            h++;
        }
        if (j != e.ss) {
            j = (j + 1) % 60;
            m++;
        }
        if (i == e.ff and j == e.ss)
            break;
    cout << max((h * 60 + m) - k, 0) << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:27:12: note: to match this '{'
   27 | int main() {
      |            ^
Language: Java


import java.util.*;
import java.io.*;

public class first {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] str = (br.readLine()).trim().split(" ");
		int h1 = Integer.parseInt(str[0]);
		int m1 = Integer.parseInt(str[1]);
		int h2 = Integer.parseInt(str[2]);
		int m2 = Integer.parseInt(str[3]);
		int k = Integer.parseInt(str[4]);

		int tt = (h2 * 60 + m2) - (h1 * 60 + m1);
		System.out.println(tt - k);
		return;
	}

}


Compiler output:
Main.java:5: error: class first is public, should be declared in a file named first.java
public class first {
       ^
1 error
Language: C

#include<stdio.h>
#include <iostream>

int main(int argc, char *argv[]){
    int H1 = atoi(argv[1]);
    int M1 = atoi(argv[2]);
    int H2 = atoi(argv[3]);
    int M2 = atoi(argv[4]);
    int K = atoi(argv[5]);

    int wakeUpTime = H1 * 60 + M1;
    int sleepTime = H2 * 60 + M2;;

    int studyTime = sleepTime - wakeUpTime - K;

    printf("%d",studyTime);

	return 0;
}

Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
      ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
long long a,b,c,d,k;
cin>>a>>b>>c>>d>>k;
    b+=a*60;
    d+=c*60;
    int ans=d-b-k;
    cout<<ans<< endl;
      return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
      ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
long long a,b,c,d,k;
cin>>a>>b>>c>>d>>k;
    b+=a*60;
    d+=c*60;
    int ans=d-b-k;
    cout<<ans<< endl;
      return 0;
}



Compiler output:
a.cc:16:5: error: redefinition of 'int main()'
   16 | int main()
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main()
      |     ^~~~
Language: C

#include<stdio.h>

int main(){
    int i;
    int H1, H2, M1, M2, K;

    scanf_s("%d%d%d%d%d", H1, M1, H2, M2, K);

    printf("%d", (H2 - H1) * 60 + (M2 - M1) - K);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |     scanf_s("%d%d%d%d%d", H1, M1, H2, M2, K);
      |     ^~~~~~~
      |     scanf
Language: C++

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

int main() {
    int H_1, M_1, H_2, M_2, K;
    cin >> H_1 >> M_1 >> H_2 >> M_2 >> K;

    int kakusei_time;
    int study_times;
    kakusei_time = (M_2 + H_2 * 60) - (M_1 + H_1 * 60);
    if(kakusei_time == 0){
        count << 0 << endl;
    }else if(kakusei_time % K == 0){
        study_times = kakusei_time / K - 1;
        cout << study_times * K << endl;
    }else{
        study_times = kakusei_time / K;
        cout << study_times * K << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   12 |         count << 0 << endl;
      |         ~~~~~~^~~~
Language: C++

#include <iostream>
#include <vector>

int main(int argc, char* argv[]) {
	int m1, h1, m2, h2, k;
	scanf_s("%d %d %d %d %d", &h1, &m1, &h2, &m2, &k);

	const int wake = 60 * h1 + m1;
	const int sleep = 60 * h2 + m2;

	const int deadline = sleep - k;

	int ans = deadline - wake;

	printf("%d\n", ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    6 |         scanf_s("%d %d %d %d %d", &h1, &m1, &h2, &m2, &k);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
 
int main(){
  
  int H1,M1,H2,M2,K;
  
  while((0<=H1<=23)&&(0<=H2<=23)&&(0<=M1<=59)&&(0<=M2<=59)&&(H1<=H2)&&(M1<=M2)){
  while(scanf("%d %d %d %d %d",&H1,&M1,&H2,&M2,&K)=0);
  }
  
  int h=H2-H1;
  int m=M2-M1;
  int T=h*60+m-K;
        
        printf("%d",T);
        
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:51: error: lvalue required as left operand of assignment
    8 |   while(scanf("%d %d %d %d %d",&H1,&M1,&H2,&M2,&K)=0);
      |                                                   ^